mersenneforum.org > Math Pretty Pictures
 Register FAQ Search Today's Posts Mark Forums Read

 2004-12-03, 18:06 #1 Orgasmic Troll Cranksta Rap Ayatollah     Jul 2003 64110 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: Attached Thumbnails   Last fiddled with by Orgasmic Troll on 2004-12-03 at 18:11
 2004-12-03, 18:16 #2 Orgasmic Troll Cranksta Rap Ayatollah     Jul 2003 641 Posts Feel free to add your own mathematical pictures
 2004-12-03, 19:03 #3 Spherical Cow     Nov 2004 21C16 Posts Nifty idea; so at twin primes, your ant does an abrupt about-face. 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?
 2004-12-03, 22:18 #4 Zeta-Flux     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, Zeta-Flux
 2004-12-03, 22:42 #5 Spherical Cow     Nov 2004 22×33×5 Posts In re-reading 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 about-face, but not the first.
 2004-12-03, 23:05 #6 Fusion_power     Aug 2003 Snicker, AL 7×137 Posts TravisT Methinks you have re-invented the Big Bang! It was done by an ant even! Fusion
2004-12-04, 02:01   #7
JuanTutors

Mar 2004

1FD16 Posts

Quote:
 Originally Posted by Spherical Cow In re-reading 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 about-face, but not the first.
I'll wait for TravisT's response, but my guess would be the second case b/c there are quite a few long lines followed by very small curls.

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.

2004-12-04, 07:34   #8
Orgasmic Troll
Cranksta Rap Ayatollah

Jul 2003

641 Posts

Quote:
 Originally Posted by Spherical Cow In re-reading 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 about-face, but not the first.
It is the second case. For example, if you had a string of directions where

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]]]

 2004-12-04, 07:55 #9 jinydu     Dec 2003 Hopefully Near M48 175810 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 2004-12-04 at 07:59
 2004-12-04, 08:11 #10 jinydu     Dec 2003 Hopefully Near M48 175810 Posts Never mind, I take that back. Here's the image for 10000 primes: Attached Thumbnails   Last fiddled with by jinydu on 2004-12-04 at 08:12
2004-12-04, 11:42   #11
Orgasmic Troll
Cranksta Rap Ayatollah

Jul 2003

28116 Posts

Quote:
 Originally Posted by Spherical Cow Nifty idea; so at twin primes, your ant does an abrupt about-face. 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?
I didn't check on my picture, but I double checked Jinydu's pic and put a circle at the origin. It is actually extremely far right (the x coordinates range from -5893 to 119)

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

 Similar Threads Thread Thread Starter Forum Replies Last Post pepi37 Programming 13 2017-07-28 03:06 tapion64 Miscellaneous Math 40 2014-04-20 05:43 R.D. Silverman Cunningham Tables 2 2009-06-19 01:39 mfgoode Puzzles 18 2007-09-21 08:06 Joe O Prime Sierpinski Project 3 2007-06-02 21:28

All times are UTC. The time now is 02:52.

Thu May 13 02:52:14 UTC 2021 up 34 days, 21:33, 1 user, load averages: 3.35, 3.40, 3.29