Tree Rings - Palindrome Prime Numbers as Art


Tree Rings” – a polar representation of prime numbers < 10 million which are also their own palindromes. Math as art. I started teaching myself C programming a few weeks ago. I wrote a program to find prime numbers. The first one was clunky and slow and would crash around 3k. So I pulled it apart and learned more about memory management. And I figured out ways I could optimize it (like automatically skipping even numbers). And now it can spit out the primes up to 2 billion in 56 seconds.The single greatest find of this process which brought me inordinate joy was combing through the numbers and figuring out that my twins’ birthdate in MMDDYYYY is prime! Ever restless I thought – now I should write some code to extract all the prime numbers which are their own palindrome. I grabbed the ones up to 10 million.Then I made a visualizer for the data in Max/MSP that you see here. To my delight, with my graphing approach of straight lines drawn between the cartesian points (x,y=x) mapped to a polar space (x, x/(2*Pi) -although admittedly going “backwards” from true polar here) the results look like tree rings!The gaps are a natural product of the palindrome filter! The first big ring you see is the 1M band. Then it must jump to 3M, 7M, & 9M. You can’t have anything in the 2M, 4M, 5M, 6M, or 8M bands because when you reverse them they couldn’t possibly be prime. (Even or divisible by five.)