1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Distribution of Primes

  1. Feb 9, 2008 #1
    I made this simple program to list all non-primes (ignore the first row and column of the output) and list what I call "important numbers". I have attached an output if you don't want to bother running and compiling the program.

    Code (Text):
    #include <iostream>
    #include <fstream>
    using namespace std;

    int main ()
        ofstream output;
        output.open ("output.txt");
        int i;
        int j;
        int n;
        cout<<"Size? ";
        int repeat[n*n];
        for (j=1;j<=n;j++) {
            for (i=1;i<=n;i++) {
        output<<endl<<endl<<endl<<"IMPORTANT NUMBERS:"<<endl;
        for (i=1;i<=(n*n);i++) {
            if (repeat[i]>=6) {
        return 0;
    Anyway, taking a look at the attached text file, I noticed that the "important numbers" (those which occurred 6 or more times in the grid) were more likely than a random number to have a prime before it or after it (at least for small numbers). After a Google search, I found out that a similar definition to my "important numbers" is given to "abundant numbers" and "super-abundant numbers" and "highly abundant numbers" -- that is they are determined by a high number of factors (for example, 12 = 1*12 = 2*6 = 3*4), just in a slightly different way.

    I then began to wonder, is there a set of numbers that can be generated using a simple pattern such that every number in that set is one less than or one greater than a prime? Is there another set such that every prime is either one less than or one greater than a number in that set? Well, I haven't gotten far from this point.

    I have found the set of numbers defined as: n(x) = 2((x^2)-x); where x is an integer greater than or equal to two, is more likely to have primes before or after its members, but that's about it.

    Attached Files:

  2. jcsd
  3. Feb 9, 2008 #2
    Unless it is much more likely then you aren't going to get any rewards.
  4. Feb 9, 2008 #3
    I know. It's more likely than random, but that's about it.
  5. Feb 9, 2008 #4
    Try and estimate the likelihood of it bing a prime as well as give your confidence intervals. See what kind of statistical tests you can do to validate or invalidate your theory.
  6. Feb 9, 2008 #5


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If a particular number has a lot of factors, then none of them can divide the previous number.

    This effect is only really relevant for "small" numbers. When you start looking at large numbers, there are just to many 'candidate' prime factors.
  7. Feb 9, 2008 #6
    Yeah, I neglected the "at least for small numbers" in my second post.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook