Saturday, November 15, 2003

 

Implementing the partial difference integration

I've talked about my find of a partial difference equation that you can integrate to get a count of prime numbers, and given some quick instructions, but I saw one post that leads me to consider that there are differences between how programmers tend to think, and how others do, so here's some additional help on the instructions.

Here's the difference equation and the instructions for the integration:

dS(x,y) = [p(x/y, y-1) - p(y-1, sqrt(y-1))][ p(y, sqrt(y)) - p(y-1, sqrt(y-1))],

S(x,1) = 0.

Note that it's a discrete function, so for you programmers that means you need to use int's or long's or some discrete variable type.

Like if you're using Java or C++, you'll need to cast the sqrt() function, though I saved the cast for what follows in a C++ program I posted:

And p(x, y) = floor(x) - S(x, y) - 1, and you get S as the sum of dS from dS(x,2) to dS(x,y).

That is, you can get away with just casting x, to something discrete, while using non-discrete x and y, but it's just a waste of storage space.

For programmers "you get S as the sum of dS from dS(x,2) to dS(x,y)" means you sum up to and including y, as I don't doubt some of you may write something like

for (i=2; i<y; i++;){}

which is WRONG, and if you do that you will probably get a wrong answer.

Note: p(x,sqrt(x)) here gives the same value as the traditional pi(x).

For faster calculations you need to use

dS(x,y) = [ p(x/y, sqrt(x/y)) - p(y-1, sqrt(y-1)][ p(y, sqrt(y)) - p(y-1, sqrt(y-1))]

when sqrt(x/y) < y-1.

That's a BIG deal, as the pure math implementation is VERY SLOW, and even that quick speed-up won't push you very far.

However, the point is that the difference equation integration does work, which those of you who can program can verify for yourselves.

Then you should search to see if ANYONE has ever used a partial difference equation integration to get a count of prime numbers because then you can see that yes, I'm the only one in recorded history to present this method.

The above instructions are easy enough to program into a computer and if you follow them, you'll notice that you do get a correct count for prime numbers, and you should also notice that unless y is prime dS(x,y) = 0, so yes, it'll also tell you which numbers are prime.

The research is a shining example of the importance of independent researchers willing to check in areas that more staid academics think are fallow.

The independent researcher is important for the future.





<< Home

This page is powered by Blogger. Isn't yours?