# Is that a Formula?

1. Apr 13, 2010

### smslca

Is that a Formula???

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
*******************************/
#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".

2. Apr 13, 2010

### epkid08

Re: Is that a Formula???

There already exists a formula for the primes.

3. Apr 13, 2010

### smslca

Re: Is that a Formula???

what is that??

4. Apr 13, 2010

### smslca

Re:factorization???

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.

5. Apr 14, 2010

### smslca

Re: Is that a Formula???

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.

6. Apr 14, 2010

### CRGreathouse

7. Apr 15, 2010

### Tac-Tics

Re: Is that a Formula???

It's very simple to define an algorithm (or "formula") for generating all the primes. Here is a small Python 2.6 function that will tell you if a number is prime. If you want to print out all primes, you can walk through the integers, asking the function if it's a prime, and then printing it out if it is.

Code (Text):

def isPrime(x):
primes = []
n = 2
while n <= x:
hasDivisor = False
for p in primes:
if n % p == 0:
hasDivisor = True
break
if not hasDivisor:
primes.append(n)
n += 1
return x in primes

This algorithm is based on the sieve of Eratosthenes. It's probably the oldest known prime-testing function. It's terribly inefficient and useless for practical purposes. The bigger primes take incredibly long to test.

The interesting feature of primes is that all known methods to test them are terribly inefficient (although they do get much better than this one).

The difficulty isn't in coming up with a way to test if a number is prime. The difficulty is coming up with a way to test if a number if prime in an efficient way.

Currently, security model for all of the Internet is based on the fact that prime testing is inefficient and really big numbers are hard to factor.

8. Apr 15, 2010

### CRGreathouse

Re: Is that a Formula???

Just the latter, I think. Prime testing is easy, prime testing "beyond a reasonable doubt" is even easier, but factoring is hard.

Factoring a 'hard' 1000-bit semiprime is currently infeasible (over a million core-years, and probably a petabyte for the linear algebra). A prime of that size can be certified by Pari in 4.2 seconds (and surely specialized software can beat that).