- #1
- 1,158
- 4
Sometimes i like to waste my time observing the behavior of certain functions and identify any patterns. Most of the time i just look at the differences (absolute value) between two consecutive elements of a sequence of numbers and look for a pattern. If no pattern is evident i take the difference of the differences and look for a pattern again, and so on.
This creates a triangle of differences. Recently i did a program that does all of this work automatically and so i had some fun generating the triangle for various functions.
I did it for the primes and found no pattern, naturally, save for some scattered n-sized triangles of 0s, bounded by 2s, like the following:
http://www.bloo.us/temp/primes.aspx?id=0
I also tried an exponential function, 2^n and obtained a cool triangle:
http://www.bloo.us/temp/primes.aspx?id=6
But i found really interesting was the polynomial functions. Granted I'm not a mathematician, but i found the following result surprising:
- for any polynomial of the form ax^d + bx^(d-1) ... cx^0, after d+1 rows all the differences become 0. This means that the (d+1)th differences are all the same. Hard to explain, easier to look at it:
For x^2:
http://www.bloo.us/temp/primes.aspx?id=1
Differences at d+1 row are all 2
For x^3:
http://www.bloo.us/temp/primes.aspx?id=2
Differences at d+1 row are all 6
For x^4:
http://www.bloo.us/temp/primes.aspx?id=3
Differences at d+1 row are all 24
For 23x^3 + 5x^2:
http://www.bloo.us/temp/primes.aspx?id=4
Differences at d+1 row are all 138
For 6x^4 + 11x^3 + 4x^2:
http://www.bloo.us/temp/primes.aspx?id=5
Differences at d+1 row are all 144
What seems to follow is that there's no polynomial that produces all the primes. There's no polynomial that produces the first 200 primes either. Though i can, from looking at the primes' triangle see that there is a degree 2 polynomial that produces:
41 43 47 53
And another degree 2 polynomial that produces:
673 677 683 691 701
etc...
But most of it is non-polynomial. The problem is that the differences of a polynomial are either increasing or the same, there's never any zeros and the primes' triangle is filled with 0s.
I have the triangle for the first 200 primes:
http://www.bloo.us/temp/primes200.htm
It's pretty big, about 2Mb.
This creates a triangle of differences. Recently i did a program that does all of this work automatically and so i had some fun generating the triangle for various functions.
I did it for the primes and found no pattern, naturally, save for some scattered n-sized triangles of 0s, bounded by 2s, like the following:
http://www.bloo.us/temp/primes.aspx?id=0
I also tried an exponential function, 2^n and obtained a cool triangle:
http://www.bloo.us/temp/primes.aspx?id=6
But i found really interesting was the polynomial functions. Granted I'm not a mathematician, but i found the following result surprising:
- for any polynomial of the form ax^d + bx^(d-1) ... cx^0, after d+1 rows all the differences become 0. This means that the (d+1)th differences are all the same. Hard to explain, easier to look at it:
For x^2:
http://www.bloo.us/temp/primes.aspx?id=1
Differences at d+1 row are all 2
For x^3:
http://www.bloo.us/temp/primes.aspx?id=2
Differences at d+1 row are all 6
For x^4:
http://www.bloo.us/temp/primes.aspx?id=3
Differences at d+1 row are all 24
For 23x^3 + 5x^2:
http://www.bloo.us/temp/primes.aspx?id=4
Differences at d+1 row are all 138
For 6x^4 + 11x^3 + 4x^2:
http://www.bloo.us/temp/primes.aspx?id=5
Differences at d+1 row are all 144
What seems to follow is that there's no polynomial that produces all the primes. There's no polynomial that produces the first 200 primes either. Though i can, from looking at the primes' triangle see that there is a degree 2 polynomial that produces:
41 43 47 53
And another degree 2 polynomial that produces:
673 677 683 691 701
etc...
But most of it is non-polynomial. The problem is that the differences of a polynomial are either increasing or the same, there's never any zeros and the primes' triangle is filled with 0s.
I have the triangle for the first 200 primes:
http://www.bloo.us/temp/primes200.htm
It's pretty big, about 2Mb.
Last edited by a moderator: