Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Is that a Formula???

  • 13-04-2010 6:38pm
    #1
    Registered Users, Registered Users 2 Posts: 28


    I think I have worked out a formula for Prime Numbers. I said, "I think," because

    1. I dont know , Is that formula already there at present.
    2. I dont know , does what I found is really should be called as a Formula.

    I made the 2nd point because, In these Type of formulas, For ex take " prime numbers "There must be solution for every given natural number(N).

    --Actually this Equation generates all Primes, But with some non-primes for a given N.
    So what I actually mean is There misses some N values in the series.

    --There are two simple equations to generate Primes along with non-Primes.

    **--I have created/discovered/worked out equations for the values of N with non-primes.
    That mean If N satisfies the equation it is the non-prime N.

    -- There are total of 40 equations to eliminate the non-primes. In which only 4 or 6
    equations are used for each N.

    **--I mainly doubt it as a formula because, there are just two same variables in all 40
    equations, since each equation is unique and different from other, no two equations
    can be equated to solve for variables.

    So, We have to guess one variable, and for larger N value, guessing will become more
    difficult.

    As I said for each N we have to use 4 or 6 eqns , as per my caluculations, for each eqn
    requires N/30 guessings. If we have luck in the first equation, it ends with N/30, But if it
    goes to last 6 th eqn we have to do, 6*n/30=N/5 guessings.

    ** You must know that Here N does not represent the conventional 1,2,3,4,.... series
    N, because in that N is normal numbers and prime Numbers ex. N=2 is a prime Number.
    But In my equation, N=2 creates a prime.

    What I want to say is that N/30 is different from conventional N/30 and is far more
    less value than conventional.

    -- The guessing values has a pattern We must follow to get the value. It is not selected
    at random.

    achievements with this equation.

    -- I have created a C program by using those equations without eliminating the non-primes. So by using logics we could
    generate the whole list of primes.
    ** The "Time" it took is the important part of eqn:
    In my Windows XP, Intel pentium 4, 2.66Ghz, 960MB ram system,
    To generate first billion Primes, It took, approximately (not accurate)
    1. >22.5 hrs for conventional method
    /* To generate Prime numbers by conventional method */
    #include <stdio.h>
    main()
    {
    int n,i=1,j,c;
    printf("Enter Number Of Terms");
    printf("Prime Numbers Are Follwing");
    scanf("%d",&n);
    while(i<=n)
    {
    c=0;
    for(j=1;j<=i;j++)
    {
    if(i%j==0)
    c++;
    }
    if(c==2)
    printf("%d ",i);
    i++;
    }
    getch();
    }

    2. 7-9hrs or greater about extra 3-4 hrs for the fastest method I found.

    /******************************
    * THIS IS THE EASIEST
    * METHOD OF GENERATING
    * PRIME NUMBERS USING C
    * MADE BY: githambo(at)gmail.com
    *******************************/
    #include<stdio.h>
    #include<math.h>
    int main()
    {
    int i,j,h,n;
    printf("Start:\a\n");
    scanf("%d",&n);
    printf("End?\n\a");
    scanf("%d",&h);
    for(i=n;i<h;i++)
    {
    for(j=2;j<i;j++)
    {
    if(i%j==0)
    break;
    }
    if(i==j)
    printf("%d\t",j);
    }
    getch();
    }

    3. By my method, it took 2-3 hrs.


    -- *** These eqns can even find the factors for the product of prime numbers.
    It took less than 00:00:00.25secs(hr:min:sec.msec form) to factorize the value of
    2,147,483,641 , I took it because 2,147,483,647 is the last value I can give to that
    program using C or to my computer.

    -- I dint write a program by eliminating non-primes because, there is a problem due to guess
    of values to the variables.
    If any one just finds any pattern and get another equation with the same variables finding
    factors for a large ie of any large product of primes will be done in less than a second.

    There must be some pattern lurking in the process I done.


    Upto Now I didnot reveal the equation, because,

    I read somewhere, If U find a formula for primes U will be popular.
    "**If what I have worked out is a formula**",(when judged by others) Then I wll get fame .
    I like to be famous and popular, if there is my name just near to the formula I will be so
    happy. Also my sister's name who helped me.

    In the Internet in Wikipedia I read about "Peer review", I cant understand it clearly because I dont know English perfectly.
    So what is the Peer Review, and where are the places, I can submit my work to be judged, as formula or as piece of waste.
    I also read that we can get patent for a computer program involving mathematical formula, and which can be useful for many other purposes. So If it is a formula discovered only by me can I get patent for the C program I created.

    Please Read the whole matter carefully and answer to my questions written "In the first" and "At the last".


Comments

  • Posts: 0 [Deleted User]


    No, these are algorithms, or methods, to generate prime numbers.

    A formula would be able to give you just say, the nth prime number. Your method goes through every number up to a number m, and checks if they are prime.
    These are also known algorithms.


  • Registered Users, Registered Users 2 Posts: 3,745 ✭✭✭Eliot Rosewater


    Those computer algorithms are very very inefficient, though I don't know if they're yours or whether you're just using them as an example of how slow they are. Your post isn't clear! I'll illustrate why they're inefficient using an example.

    Suppose you want to find if the number 1594587 is prime. In your program you start at 2 and check every single number against 1594587. This is unnecessary. First, you only need to check from 2 to the square root of 1594587. If there is a factor of 1594587 bigger than [LATEX]\sqrt{1594587}[/LATEX] there will be a corresponding factor smaller than [LATEX]\sqrt{1594587}[/LATEX].

    Secondly, you don't need to check every number between 2 and [LATEX]\sqrt{1594587}[/LATEX], you only need to check prime numbers between 2 and [LATEX]\sqrt{1594587}[/LATEX].


  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    Google Riemann hypothesis.


  • Registered Users, Registered Users 2 Posts: 28 smslca


    But I am somewhat not perfectly sure the method to factorize is New. I have already done some work.

    Ok since there is already a formula I should show mine, without applying to any peer review or any other.
    I dont know any mathematics lecturer or teacher near to me to show my work. What should I do ???
    As I already said, I dont know this eqn is already present of not. And I wont say my work is best compared to others.
    I am worried about fame because, I have worked on this for 3 full weeks, without doing any other works.

    (2)But I am sure that "just One more pattern found in my work, it further reduces the time to factorize, as compared to the present program written by me." It involves loops.

    (3)And If any one can find " one more relationship between the two variables and can be solved then The factorization of very very long primes will be an instant i.e takes a second." . It means it doesnt require any loops to factorize product of primes

    If any one can write a program to below order of multiplication, As they are sorted in an increasing order, it reduces the time taken to factorize by the present program by me. But not less time what I said in (2).
    07*13=91
    07*23=161
    17*13=221
    07*43=301
    07*53=371
    17*23=391
    37*13=481
    07*73=511
    07*83=581
    47*13=611
    07*103=721
    17*43=729

    Here U can observe that "only digits front to the unit digits are only changing" and there are no numbers 2,5,7,
    2+3x before 7, and 3,6,9,
    3x where x=0,1,2,3,
    as they generates multiples of 3.


  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    I don't want to cast doubt on what you've done but it's very difficult to see without having your formula. Also, you realise that the primes are up into the the millions of digits now so even decreasing the time by a fixed factor isn't particularly useful. Your formula halves the time roughly for first billion primes you say. I'm not sure what complexity class the most efficient prime finding algortihms are but dividing something complex by two doesn't make it any less complex essentially.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Hi,
    First of all, let me say congratulations on trying to work a problem like this out for yourself. It's more than most people manage, and it really is the best way to learn.

    I don't want to discourage you, but this is an extermely hard problem. If there were an easy way to do it which didn't require years of effort to develop, someone would have done it by now. You said you spent three weeks on this. You should remember that many people have already spent their whole lives looking at the problem.

    In fact, there are two different problems: checking if a number is prime, and factorizing a number. Surprisingly, it's often much easier to check if a number is prime than to factorize it. The longest known prime os over a million digits long, whereas we struggle to factor numbers more than a couple of hundred digits long.

    I noticed you can code in C. does this mean you know what algorithmic complexity means? Primality testing has recently been shown to be a polynomial-time algorithm. This was a major breakthrough in mathematics.

    You should read these articles if you haven't already:
    http://en.wikipedia.org/wiki/Primality_test
    http://en.wikipedia.org/wiki/AKS_primality_test
    http://en.wikipedia.org/wiki/Integer_factorization

    I would suggest contacting a computer scientist or mathematician at a university close to you and discussing your idea. Don't worry about them stealing the credit. To be blunt, it is very unlikely that you have a genuinely new idea. The goal here is to learn as much as possible from what you have done. If you did happen to be right, anyone you contact will just want to help you write a paper so they can put their name on it.

    If you really think you have something new, you could write it up in LaTeX and post it on arxiv.org. Arxiv is a website for papers which are in the process of being written. Every paper is gaven a date and time signature, along with your name, so that you have proof that you had the idea at that time. That way, no-one can steal your idea.


  • Registered Users, Registered Users 2 Posts: 28 smslca


    Fremen wrote: »
    Hi,
    First of all, let me say congratulations on trying to work a problem like this out for yourself. It's more than most people manage, and it really is the best way to learn.

    I don't want to discourage you, but this is an extermely hard problem. If there were an easy way to do it which didn't require years of effort to develop, someone would have done it by now. You said you spent three weeks on this. You should remember that many people have already spent their whole lives looking at the problem.

    In fact, there are two different problems: checking if a number is prime, and factorizing a number. Surprisingly, it's often much easier to check if a number is prime than to factorize it. The longest known prime os over a million digits long, whereas we struggle to factor numbers more than a couple of hundred digits long.

    I noticed you can code in C. does this mean you know what algorithmic complexity means? Primality testing has recently been shown to be a polynomial-time algorithm. This was a major breakthrough in mathematics.

    You should read these articles if you haven't already:
    http://en.wikipedia.org/wiki/Primality_test
    http://en.wikipedia.org/wiki/AKS_primality_test
    http://en.wikipedia.org/wiki/Integer_factorization

    I would suggest contacting a computer scientist or mathematician at a university close to you and discussing your idea. Don't worry about them stealing the credit. To be blunt, it is very unlikely that you have a genuinely new idea. The goal here is to learn as much as possible from what you have done. If you did happen to be right, anyone you contact will just want to help you write a paper so they can put their name on it.

    If you really think you have something new, you could write it up in LaTeX and post it on arxiv.org. Arxiv is a website for papers which are in the process of being written. Every paper is gaven a date and time signature, along with your name, so that you have proof that you had the idea at that time. That way, no-one can steal your idea.

    Thank U so much. Iam waiting for this type of answer.


  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Welcome :D


  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    I just remembered, this is a very good resource for this kind of thing:
    http://mathforum.org/dr/math/

    Mathematicians volunteer time to answer people's questions, ranging from basic to very technical.


  • Registered Users, Registered Users 2 Posts: 28 smslca


    Those computer algorithms are very very inefficient, though I don't know if they're yours or whether you're just using them as an example of how slow they are. Your post isn't clear! I'll illustrate why they're inefficient using an example.

    Suppose you want to find if the number 1594587 is prime. In your program you start at 2 and check every single number against 1594587. This is unnecessary. First, you only need to check from 2 to the square root of 1594587. If there is a factor of 1594587 bigger than [LATEX]\sqrt{1594587}[/LATEX] there will be a corresponding factor smaller than [LATEX]\sqrt{1594587}[/LATEX].

    Secondly, you don't need to check every number between 2 and [LATEX]\sqrt{1594587}[/LATEX], you only need to check prime numbers between 2 and [LATEX]\sqrt{1594587}[/LATEX].

    are you talking about 6x+1,6x-1 formula,If u r

    Even if u remove numbers like multiples of 2,3,5 etc then what about numbers like 49 etc(also numbers below sqrt(N))
    What I mean is u have to divide it by (only primes+numbers like 49 etc).

    what if you have to check numbers only below cuberoot(N)--(After all this discussion I have a upper limit as cubrt, and im trying to get lower limit to reduce the No of loops). And What if we have to check with only numbers like 49,etc.Also as I said N is not a number you have to check, it is less than the number we have to check.

    If above suggestions work, am I successful. Did I got any sucess over above formula.

    If u r not talking about not that formula please write down, or give an idea about the specific formula you are talking about.


  • Advertisement
  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    What he is saying is that every composite number n must have a factor less than or equal to the square root of n. So if you want to check if p is prime you only need check prime factors up to square root of p.


Advertisement