20041203, 18:06  #1 
Cranksta Rap Ayatollah
Jul 2003
641 Posts 
Pretty Pictures
A while back I was playing with Ulam's spiral and wondered what it would look like if you had an "ant" that would walk in a straight line and turn left when it had walked a prime number of units. I plugged it into Mathematica and ran it up to 50,004 primes. The resulting picture reminds me of a dragon fractal. I doubt it has much mathematical value, but it's in interesting picture:
Last fiddled with by Orgasmic Troll on 20041203 at 18:11 
20041203, 18:16  #2 
Cranksta Rap Ayatollah
Jul 2003
1010000001_{2} Posts 
Feel free to add your own mathematical pictures

20041203, 19:03  #3 
Nov 2004
2^{2}·3^{3}·5 Posts 
Nifty idea; so at twin primes, your ant does an abrupt aboutface. Is the ant's starting point roughly in the center of the plot, or is there kind of a bias in one direction or another that eventually dominates?

20041203, 22:18  #4 
May 2003
7·13·17 Posts 
TravisT,
I have Mathematica but am not that good with it yet. Would you be willing to provide the code you used to get that picture? Thanks, ZetaFlux 
20041203, 22:42  #5 
Nov 2004
2^{2}×3^{3}×5 Posts 
In rereading this, I think I assumed wrong about how you were doing it. Was the distance that your ant moved each time equal to the next largest prime number, or the difference between the next prime number and the last prime? In the second case, twin primes would produce an aboutface, but not the first.

20041203, 23:05  #6 
Aug 2003
Snicker, AL
7·137 Posts 
TravisT
Methinks you have reinvented the Big Bang! It was done by an ant even! Fusion 
20041204, 02:01  #7  
Mar 2004
2^{2}×3^{3}×5 Posts 
Quote:
P.S. That picture looks cool. I would love to see what it looks like if you kept going. I also wouldn't mind seeing that code, just for fun. 

20041204, 07:34  #8  
Cranksta Rap Ayatollah
Jul 2003
641 Posts 
Quote:
U = up one unit D = down one unit R = right one unit L = left one unit then it would start out UULDDRRUUUULLDDD... The Mathematica code I used (and I don't claim to be any good, I just hacked this out) is: ptslist = {{0, 0}, {0, 2}}; pt = {0, 2} For[i = 1, i < 50000, i = i + 4, pt = pt  {Prime[i + 1]  Prime[i], 0}; ptslist = Append[ptslist, pt]; pt = pt  {0, Prime[i + 2]  Prime[i + 1]}; ptslist = Append[ptslist, pt]; pt = pt + {Prime[i + 3]  Prime[i + 2], 0}; ptslist = Append[ptslist, pt]; pt = pt + {0, Prime[i + 4]  Prime[i + 3]}; ptslist = Append[ptslist, pt]]; Show[Graphics[Line[ptslist]]] 

20041204, 07:55  #9 
Dec 2003
Hopefully Near M48
1758_{10} Posts 
Admittedly, Mathematica 4 seems to behave oddly on my computer some times. It seems to have some kind of computation threshold, and if I cross that threshold, it just keeps calculation seemingly forever... I've asked to compute 100000 such primes, and it just seems to keep evalutaing indefinitely.
Last fiddled with by jinydu on 20041204 at 07:59 
20041204, 08:11  #10 
Dec 2003
Hopefully Near M48
11011011110_{2} Posts 
Never mind, I take that back. Here's the image for 10000 primes:
Last fiddled with by jinydu on 20041204 at 08:12 
20041204, 11:42  #11  
Cranksta Rap Ayatollah
Jul 2003
641 Posts 
Quote:
I thought it might be due to the Chebyshev Bias: http://mathworld.wolfram.com/ChebyshevBias.html but it's very late and I'm not sure 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Primes as pictures  pepi37  Programming  13  20170728 03:06 
Pretty Fast Primality Test (for numbers = 3 mod 4)  tapion64  Miscellaneous Math  40  20140420 05:43 
Pretty Result  R.D. Silverman  Cunningham Tables  2  20090619 01:39 
Projected Pictures.  mfgoode  Puzzles  18  20070921 08:06 
Pretty Progress Pictures  Joe O  Prime Sierpinski Project  3  20070602 21:28 