Friday, August 10, 2012

quick follow up to my posts on prime numbers and cosine waves

just wanted to post a quick follow-up to the entry I had about cosine waves...  taking the cosine value to a higher power just helps in math terms to guarantee the values are in an acceptable range...

when actually trying to program these functions, it is best to make use of the "floor" function to scrap any values that are between 0 and 1... this helps retain only the 1 values from the waves in the SUM, and is less taxing on the computation.

so rather than SUM(Cosine(pi*n/k)^(2^n), for k = {1,n}), utilizing SUM(FLOOR(Cosine(pi*n/k))) will yield the same results as the sigma/divisor functions.

that's all, just wanted to throw that out there in case anyone has read this and actually wants to implement it!


more details on the FLOOR function and its applications can be found here:  http://en.wikipedia.org/wiki/Floor_and_ceiling_functions

Wednesday, August 1, 2012

scribbles from 2009 - sigma and divisor functions

More prime stuff

Took photos of my notes rather than typing out the formulas.  Playing around with the cosine waves led me to this summation in 2009, Using cosine squared keeps the function even and continuous (the absolute value of cosine has non-differentiable points, or cusps). 

Description from Wikipedia (http://en.wikipedia.org/wiki/Divisor_function):
 "...
The sum of positive divisors function σx(n), for a real or complex number x, is defined as the sum of the xth powers of the positive divisors of n, or
\sigma_{x}(n)=\sum_{d|n} d^x\,\! ...."
Here are the first two of these sigma functions as determined by my cosine representation, the divisor function δ(n), and the sum of divisors function σ(n):



These equations should probably have a '~' over the equals signs... By way of construction, these waves only equal 1 when N is divisible by the K value.  I took the cosine squared function to the Nth power because it would be positive, even (and symmetric), retain all 1 values, and minimize any values that were less than 1 (making use of the fact:  if 0 < x < 1, then lim [x^n] = 0 as n à ). 

Here is another clip from my notes where I've represented sigma function with a slightly different ordering:


The sigma and divisor functions have so many applications throughout mathematics and they are related to many unsolved problems.  I'm still looking for a closed-form equation, but haven't found the right path to go down... Lots of "rabbit trails" that seem promising at first, but end up winding in circles.  I keep thinking there might just be some trig identity that helps collapse sums of waves, but haven't found it yet. 


Kind of related, from 2008:

I also found a conjecture of mine concerning the amount of prime numbers between powers of 2... No proof yet, but computer tests look promising as the "i" value increases to infinity, the error value decreases to 0...


Simply put, let π(n) be the number of prime numbers less than or equal to n

If...
C = π(2^n) = the number of primes up to 2^n
A = π(2^(n-1))      and...
B = π(2^(n-2))      ...

Then C < 3A-2B

The number of primes up to 2^n is less than three times the primes up to 2^n-1 minus twice the primes up to 2^n-2.

From my notes, I had written, "the number of primes in between 2^i and 2^(i+1) is less than 2 times the number of primes between 2^(i-1) and 2^i.

Equation form:

π(2^(i+1)) - π(2^i) < 2 * [ π(2^(i)) - π(2^(i-1)) ]
==>
π(2^(i+1)) - π(2^i) < [ 2*π(2^(i)) - 2*π(2^(i-1)) ]
==>
π(2^(i+1)) < 3*π(2^(i)) - 2*π(2^(i-1))
==>
π(2^i) < 3*π(2^(i-1)) - 2*π(2^(i-2))

So after a little manipulation, and shifting the index, you get the same inequality as shown in the conjecture... I've tried studying recursion with these kinds of inequalities, but found that the accuracy decreases as you expand further..

I've found that the conjecture fails when i=5, but couldn't compute high enough to find another exception to the rule.  Here is that example:

π(2^5) = π(32) = 11  prime numbers up to 32:  (2,3,5,7,11,13,17,19,23,29,31)

but

π(2^4) = π(16) = 6  prime numbers up to 16: (2,3,5,7,11,13)
π(2^3) = π(8) = 4  prime numbers up to 8:  (2,3,5,7)

3 * π(2^4) - 2 * π(2&3) = 3*6 - 2*4 = 10  < 11...

So π(32) is not less than 3*π(16) - 2*π(8) as the conjecture suggests it should be, it's off by 1...

That's the only hiccup that I've found in testing this conjecture.  I have yet to find another value for 'i' which causes the inequality to fail, but that's only as far as my computer can count for now - better programming will yield better results. It's very possible that way down the number line, some huge power of 2 exists that has more primes than the estimate... but that's why it's still a conjecture!


Thanks for reading - that's more than enough prime numbers for today :)