Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Interesting method for prime discovery?

  1. Apr 8, 2010 #1
    Hi, what I did to try to find prime numbers was this (in a computer program)

    Starting from 2, I set off a sine wave that has an amplitude=0 for every even number and an amplitude=1 for every odd number. What we are looking for, then, are the portions of the sine wave where the derivative (slope) is zero (ie, a local maximum).

    It is easy to see that this will occur precisely at the integer, 3. Then, I repeat the process, such that, starting at 3, I set off a 2/3 probability wave, meaning that it on touches down on every third number.

    Here's where things start to get interesting. According to the 2-wave, the next maximum is precisely at 5, and according to the 3-wave, it is precisely at 4.5 (directly in between 3 and 6).

    So what I did to find the next maximum was to sum the [absolute values of the] amplitudes of the two waves into a composite waveform, and the next maximum was somewhere around 4.85 (The level of granualarity between integers was .01).

    At this point, I realized that I needed to do some filtering, such that maximums that were within 20% of the nearest integer would qualify as being "good hits" (ie prime numbers) while the maximums outside of this range could be discarded. Actually, it seemed that anywhere between 15-20% would suffice because, regardless of the value, there would be the same total of: non-primes that were taken as being "good" and primes that were "no good". But by in large, this process worked rather well in the domain from 2-100.

    Here is the data:

    6 primes were outside of the 20% boundary, with the worst being 29% away.

    12 non-primes were accepted, that should not have been.

    About 40 non-primes were successfully filtered out.

    But the really interesting thing is that many of the values that I got were strongly correlated to the halves of the imaginary values of the Riemann zeros. ie 1/2 of the first zeta zero is about 7.07 vs one of my maximums is 7.19.

    And here was the most interesting string of correlated values (the first is mine):
    (skipped two of his values...)

    All in all, I did get roughly the same rate of maximums as there were [halved] zeta zeros, and there seems to average a difference of around 0.5 between his number and my closest number.

    Also, I've written a program that plots the composite probability function, so that I see better now how to tell if a maximum within the 20% range should be treated as a "good hit" or not... it has to do with the level of the next maximum being lower than the level of the previous "good hit". It looks like a bearish stock trend, that, when it reverses, the next maximum that is close to the same height as the previous one will most likely be a prime number.

    My question is whether any of you think that I might have hit upon anything interesting, or whether this is a way of approaching the question of the "pattern of the primes" that has already been done.

    I haven't been able to find any references to anything like this, and I know that my method is not totally unrelated to Riemann's, because he starts his paper with the Euler product, which is just the multiplication of:

    1/(1-1/p^s), where p is all prime numbers.

    This equation can be written as:

    1/((p^s)-1)/p^s = p^s/(p^s)-1

    Well, my probability waves are simply the inverse of this, ie (p^s)-1/p^s, where s=1.

    In other words, when each new wave is generated, you get an ever diminishing probability:

    1/2 * 2/3 * 4/5 * 6/7 * 10/11 * 12/13 ...

    If anyone is interested, I can share my code with you. (The graphical stuff uses the X11 Linux library)
  2. jcsd
  3. Apr 9, 2010 #2


    User Avatar
    Science Advisor
    Homework Helper

    What do you mean by "sine wave" (clearly not what I call a sine wave), "2/3 probability wave", and "2-wave"? Do you have equations for these?

    The code might be interesting, but the equations are a must.
  4. Apr 9, 2010 #3
    Looks like he means a sine wave with frequency 2/2*pi. So it has the value of 0 at every even number and 1 at every odd number. 3 is the next prime so he creates the function sin((2*pi/3)*x) which has a value of 0 at every multiple of three. Then adds them up to get y=sin(2*pi*x/2)+sin(2*pi*x/3)... or y=the summation over p sin(2*pi*x/p) as p ranges accross all the primes. Then he looks for where y is a local maximum and it is probably a new prime.
  5. Apr 9, 2010 #4
    That's pretty much it, Robert. Here's the code:

    Code (Text):

    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>

    // Program name: find_primes.c
    // To Compile on Linux:
    // $ gcc -lm find_primes.c

    double *wave;

    void init_it() {
        wave=(double *)calloc(10000, sizeof(double));
        int i;
        //We must start with a seed wave   
        for(i=0; i < 10000; i++) {

    void add_to_wave(double num) {
        int i;
        for (i=0; i < 10000; i++) {

    int main () {

    int i, jump, got, nodice;
    double fl, ce, diff, useint;

    //All i values must be divided by 100 and rounded off to
    //get the integer value
    for (i=201; i < 10000; i++) {
        //Searching for a horizontal tangent in the waveform...
        if (wave[i] > wave[i+1] && wave[i] > wave[i-1]) {
            //What integer is closest?

            if (ce > fl) {
            else {

            //These are the prime numbers that I had to allow in
            if (diff < 20.0 || i==3123 || \
                i==3724 || i==6723 ||\
                i==7922 || i==8271 || i==8873) {

                //These are the false positives (non-primes) that I had to
                //forcefully block
                if (i!=1597 && i!=5693 && i!=6510 && i!=8496 && i!=4887 && \
                        i!=4910 && i!=5484 && i!=7419 && i!=7712 && i!=8087 && \
                        i!=9283 && i!=9518) {

                    printf("%d\n", (int)useint);

                    //Call this function to add the new wave to the composite waveform

            //Tally all successfully filtered nonprimes
            else {
            //If we get a get a hit, this just insures that we jump out of
            //the 20% range that qualifies as being a "good hit"
            //This eliminates redundacy and a corruption of the waveform
            if (got) {
    printf("Cutoff filter set at: 20% (from closest integer)\n");
    printf("Successfully filtered: %d\n", nodice);
    printf("Number forcefully blocked: 12 (avg. 11.8%% from closest integer)\n");
    printf("Number of misses that were allowed in: 6 (average miss from cutoff: 4.7%)\n");
    return 0;
  6. Apr 9, 2010 #5
    I want to make it understood that the only prime that is initially known is 2. We need to use the 2-wave as the seed in order to start the process of discovering primes. I am not using a list of prime numbers just to see what kind of waveform that results.
  7. Apr 9, 2010 #6
    glengarry: You realize that the method you are using is just a really cumbersome implementation of the sieve of Erastothenes, right?
  8. Apr 10, 2010 #7
    I understand the point about the similarity with the sieve method. But when you say that this method is "just" that, I think that you are missing the point entirely. The sieve method simply uses a range of integers and cancels out all multiples within that range. My method, however, layers all real numbers atop of the domain of integers in order to see what kind of new information can be attained from the pattern of primes.

    In other words, by making use of the Fourier wave method, the notion of the "pattern of prime numbers" takes on an entirely new depth. What I am looking for is not simply a list of prime numbers; there are already lists in existence that are much too exhaustive for me to break any new ground in that arena.

    Instead, I am interested in looking at the issue of prime numbers (and numbers in general) from a highly theoretical viewpoint, so that we can make connections between "prime wave" patterns, and for example, patterns in certain natural phenomena like the rate of increase in animal populations and patterns of a multi-scale variety such as the various time frames of market activity.

    The fact that people like Gauss, Euler, and Riemann made extensive use of the natural constant, e, and the natural logarithm when making their discoveries concerning prime numbers should tell you that there is much more to this subject than issues of simple integral factorization.

    In fact, when we are talking about taking my method to its extremes (by way of considering the composite waveform of arbitrarily many prime numbers), we are essentially talking about pure chaos. That is, when we chart wave patterns that are each necessarily "dissonant" with one another (as opposed to patterns that are multiples of one another), the result is one of unending novelty--but at the same time, there is a method to the madness.

    I have my fair share of experience trying to make money by looking for patterns in market activity. And when I say (from what few prime wave charts I've seen) that the similarities between the two phenomena are striking, I am not being overly hasty. Given enough time and patience, I expect to be able to see the various reversal and trending patterns, in various scales, that is manifest in the markets.

    So my entire point is that when we talk about prime numbers from the deepest theoretical perspective, instead of speaking of tedious lists of integers, we should rather be speaking in a language that has all of the richness and vitality of any of the natural sciences. I mean, isn't this what the number theorist is really trying to do; that is, to somehow derive the natural order itself from the seemingly purely academic, mundane world of numbers?

    Last but not least, there is always that tiny issue of proving that all roots (zeros) of the Riemann zeta function are real. It is good for a cool million for whoever can do it, and I think we can go a long way towards finding a solution by way of understanding the significance of the composite waveform. That is, by saying that a number is just the result of an equation does not allow us to understand the meaning of that number. If, as I suspect, the Riemann zeros are just those points where the composite prime number waveform has a horizontal tangent (which points must be put through various filtering methods in order to distinguish non-primes from primes), then whoever can prove this fact in a mathematical sense will be able to go on to proving how, for example, anything that is a horizontal tangent on the composite waveform must necessarily also be a real root of the Riemann zeta function.
  9. Apr 27, 2010 #8
    ... I want to be sure here... are you saying that you think the code you've written is novel, and somehow more elucidating and efficient than existing methods? You mention "1mil"... so I assume you are referring to a Nobel? Other than appreciating patterns which have been studied for a VERY long time, and taking a (new to you) approach, why do you think this is in any way... new to anyone else? This also seems like something for "Indipendant Research", not Number Theory.
  10. Apr 28, 2010 #9
    $1,000,000 is the prize for proving that the Riemann hypothesis is either true or false. That's the Millenium Prize. The equivalent award to the Nobel in mathematics is the Field's medal.

    Yes of course the thing that I came up with is "new to me." I was curious to find out if it was new to anybody else, too. If you can show me where I can go to find out who else has done something like this, let me know.

    The computer program is not the thing that will serve as any kind of proof. It is just something to share with people.

    Besides, the question of the pattern of the prime numbers is, sine qua non, THE number theory problem. The point here is that there are no existing methods when it comes to the Riemann Hypothesis. The "Independent Research" forum, from what I can tell, is for people who have something to do with physical theories that need experimental support and not about constructing things like mathematical theorems that serve as their own proofs.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook