## Request for Prime number above and below following numbers...>

Expand Messages
• Could someone calculate what prime numbers are before and after these numbers: First (R):
Message 1 of 4 , Feb 27, 2006
Could someone calculate what prime numbers are before and after these
numbers:

First (R):
11621807555883689788641587458993875777666253379102712053353601884910225
29730259514945685647148706167579671158867971528164491686715212915277413
7706185638267

Second (D):
98752721695334971214618271922383690815206501681140384484657960259844385
27299469794382882275321296973244702455573996422506863560586530381700124
666716164274

Could you also explain to me how such a calculation is made?

Thanks.
• ... R-238, R+750, D-101, D+23. ... There is no practical direct way to compute it. You have to eliminate all candidates by finding a factor or performing a
Message 2 of 4 , Feb 27, 2006
unwoundgoblin wrote:

> Could someone calculate what prime numbers are before and after these
> numbers:
>
>
> First (R):
> 11621807555883689788641587458993875777666253379102712053353601884910225
> 29730259514945685647148706167579671158867971528164491686715212915277413
> 7706185638267
>
> Second (D):
> 98752721695334971214618271922383690815206501681140384484657960259844385
> 27299469794382882275321296973244702455573996422506863560586530381700124
> 666716164274

R-238, R+750, D-101, D+23.

> Could you also explain to me how such a calculation is made?

There is no practical "direct" way to compute it.
You have to eliminate all candidates by finding a factor
or performing a primality or PRP (probable prime) test.
See e.g. http://primes.utm.edu/prove/index.html
When a PRP is found, you (usually for this kind of problem)
have to prove it prime with a relatively slow general
method like APR-CL or ECPP.

For numbers of your size, a computer program is needed.
I used PARI/GP and recommend it. My work for the prime after R:

(16:42) gp > nextprime(R)-R
%63 = 750
(16:42) gp > isprime(R+750)
%64 = 1

nextprime computes a prp. The much slower isprime makes a primality proof.

--
Jens Kruse Andersen
• ... As Jens correctly stated, there s not a (known) formula to find the next prime. It s relatively easy to brute-force it, though, simply by counting up or
Message 3 of 4 , Feb 27, 2006
unwoundgoblin wrote:
> Could someone calculate what prime numbers are before and after these
> numbers:
>
> First (R):
> 11621807555883689788641587458993875777666253379102712053353601884910225
> 29730259514945685647148706167579671158867971528164491686715212915277413
> 7706185638267
>
> Second (D):
> 98752721695334971214618271922383690815206501681140384484657960259844385
> 27299469794382882275321296973244702455573996422506863560586530381700124
> 666716164274
>
> Could you also explain to me how such a calculation is made?

As Jens correctly stated, there's not a (known) formula to find the
next prime. It's relatively easy to brute-force it, though, simply by
counting up or down from the number and running a primality test. For
your information, here's a very simple Frink program that does the same,
at least in one direction:

r = r
while(! isPrime[r]) // While not prime
r=r+2
println[r]

Frink's isPrime does probable-prime test, but against a large number
of bases. Enough bases that the probability of your hardware failing
during the calculation (and you winning the lottery and getting struck
by lightning at the same time) is much, much higher. Unfortunately, I
don't have a primality-proving routine yet.

Frink documentation:

http://futureboy.us/frinkdocs/

--
Alan Eliasen | "When trouble is solved before it
eliasen@... | forms, who calls that clever?"
http://futureboy.us/ | --Sun Tzu
• ... For numbers of this size, it s also possible to plug them into Dario Alpern s java applet with the N() and B() function for next and previous.
Message 4 of 4 , Feb 27, 2006
> As Jens correctly stated, there's not a (known) formula to find the
> next prime.

For numbers of this size, it's also possible to plug them into Dario
Alpern's java applet with the N() and B() function for next and previous.

http://www.alpertron.com.ar/ECM.HTM

William
Poohbah of OddPerfect.org
Your message has been successfully submitted and would be delivered to recipients shortly.