// This class is in the public domain.
public class Numbers
{
public static void main(String[] args)
{
int numRows = 256;
int numColumns = 128;
for (int row = 0; row Show HN: an extremely simple program shows a 2D structure in the integers
1–10 of 15 posts
Re: Show HN: an extremely simple program shows a 2D structure in the integers
#2Re: Show HN: an extremely simple program shows a 2D structure in the integers
#3Re: Show HN: an extremely simple program shows a 2D structure in the integers
#4http://en.wikipedia.org/wiki/Sierpinski_triangle
I'm sure someone with a greater intuition for mathematics than I have will be able to explain why.
Re: Show HN: an extremely simple program shows a 2D structure in the integers
#5Reminds me of Sierpinski triangles: http://en.wikipedia.org/wiki/Sierpinski_triangle I'm sure someone with a greater intuition for mathematics than I have will be able to explain why.
Re: Show HN: an extremely simple program shows a 2D structure in the integers
#6seems to be a paper on this phenomenon, with
http://faculty.msmary.edu/heinold/maa_pres2009-11-14.pdf
being a similar work in presentation form.
I've never seen it before; I like it!
Re: Show HN: an extremely simple program shows a 2D structure in the integers
#7 main(c,r){for(r=32;r;)printf(++c>31?c=!r--,"\n":c
I first learned of this phenomenon in my discrete math class, and we had a competition to see who would write the shortest program to draw a Sierpinski triangle. This version would certainly have won if I'd been clever enough to write it at the time, though even shorter versions are possible in other languages.Re: Show HN: an extremely simple program shows a 2D structure in the integers
#8 http://www.oftenpaper.net/sierpinski.htm
It points out that you can interpret the table as the relation "is disjoint" between the bitsets encoded in the row and col indices (CTRL+F for "binary logic"). Following links from there will take you to a rabbit hole of combinatorics that I will not claim to fully understand.The whole page is a delight, though, and given your enjoyment for your discovery, you'll certainly love browsing it.
Re: Show HN: an extremely simple program shows a 2D structure in the integers
#9Reminds me of Sierpinski triangles: http://en.wikipedia.org/wiki/Sierpinski_triangle I'm sure someone with a greater intuition for mathematics than I have will be able to explain why.
My first thought is that it has something to do with the fact that you get a Sierpenski Triangle from a Pascal's triangle when you assign one color to even numbers and another to odd: http://en.wikipedia.org/wiki/Pascal%27s_triangle#Overall_pat...