Time for something a little nerdier:
I stumbled across this last semester when I wrote a program to spit out times tables under different modulo values ([link]
). I noticed a pattern, so I decided to get it to spit out an image instead of a table.
This image is essentially a times table. Each pixel starting from the top left hand corner is one multiplication. Any pixel i,j holds a value of i*j (mod 1009), where black is zero, and pure white is a value of 1008
Without ranting too much, my jaw dropped when I saw this. If you follow all the details in it, there's so many overlapping patterns nested in it. And it's just multiplication. That something so simple could produce something so intricate and brain-breakish speaks volumes about how cool math actually is
If you want to play with this, here's the C code for it (it saves using netbpm because I'm lazy and didn't want to screw around with external packages, just use Google if you need to find a converter and don't want to modify the code). It'll ask you for a modulo value, so you can produce whatever size image you want
I'm planning on generalising this to real numbers rather than integers at some stage, and also making it produce a colour image. If someone plays with this, please let me know and I'll put your code up here with proper attribution.
int j,k, value, MODULO;
printf("Enter a modulo value:");
fprintf(file,"%5d %5d\n", MODULO, MODULO);
fprintf(file," %5d ", value);