mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Miscellaneous Math (https://www.mersenneforum.org/forumdisplay.php?f=56)
-   -   Thread for posting tiny primes (https://www.mersenneforum.org/showthread.php?t=13650)

CRGreathouse 2010-09-22 14:49

[QUOTE=science_man_88;230899]if I did the math correct that means 230 numbers near a googol seems to give the best chance of exactly 1 being prime at 36.7879 % I think[/QUOTE]

Exactly -- because log(1e100) is about 230.

Edit: Mini-Geek, your death will be swift.

science_man_88 2010-09-22 15:01

I put L in the code but don't I have to check every numbers for factors below a given L ? so what do i do to the code i haven't figure it out yet lol.

science_man_88 2010-09-22 15:19

that means for the 6n+1 and 6n-1 L would be at least 5

if I did the math right that would decrease 230 to about 80-81 cuts it down quite a bit.

CRGreathouse 2010-09-22 15:47

[QUOTE=science_man_88;230905]I put L in the code but don't I have to check every numbers for factors below a given L ?[/QUOTE]

No!

You're not checking n numbers, you're predicting the results if a person checks n numbers. All you have to do is adjust the probability by the factor I gave.

science_man_88 2010-09-22 15:51

[QUOTE=CRGreathouse;230915]No!

You're not checking n numbers, you're predicting the results if a person checks n numbers. All you have to do is adjust the probability by the factor I gave.[/QUOTE]

oh so multiply the final probability by that I see lol.

science_man_88 2010-09-22 15:53

[CODE](12:53) gp > poisson2(N,t,n,L) = ((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
%212 = (N,t,n,L)->((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
(12:53) gp > poisson2(10^100,20,0,5)
%213 = 2.628049047414643169717703463
(12:53) gp >[/CODE]

if I was correct

CRGreathouse 2010-09-22 15:57

[QUOTE=science_man_88;230917][CODE](12:53) gp > poisson2(N,t,n,L) = ((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
%212 = (N,t,n,L)->((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
(12:53) gp > poisson2(10^100,20,0,5)
%213 = 2.628049047414643169717703463
(12:53) gp >[/CODE]

if I was correct[/QUOTE]

Doesn't look right. Let's clean up the code and see if that makes it any easier:

[code]estimatePrimes(N,t,n,L)={
my(lambda=...);
(lambda^n*exp(-lambda))/n!
};
addhelp(estimatePrimes, "estimatePrimes(N,t,n,L): ...");[/code]

science_man_88 2010-09-22 16:23

[CODE](13:23) gp > estimatePrimes(10^100,230,1,5)
%217 = 0.1634366358216543572411964273[/CODE]

with code:

[CODE]estimatePrimes(N,t,n,L)=my(lambda=(t/log(N))*(exp(Euler)*log(L)));(lambda^n*exp(-lambda))/n!;[/CODE]

science_man_88 2010-09-22 16:32

I love how that change in code fits exactly the range of 80-81 I predicted.

CRGreathouse 2010-09-22 16:40

The code looks good.

[QUOTE=science_man_88;230910]that means for the 6n+1 and 6n-1 L would be at least 5

if I did the math right that would decrease 230 to about 80-81 cuts it down quite a bit.[/QUOTE]

[QUOTE=science_man_88;230927]I love how that change in code fits exactly the range of 80-81 I predicted.[/QUOTE]

You expect about one prime per 230 for numbers near a googol, but one prime per 115 for odd numbers near a googol and one prime per 77 for odd numbers not divisible by 3 near a googol.

So 80-81 is close, but no cigar. :smile:

CRGreathouse 2010-09-22 16:45

So now can you write a different function that takes a limit L, base b, an exponent e, and a k-range kmin,kmax and determines
1. The expected number of candidates remaining after sieving to L?
2. The number of primes in the range? (Use your estimatePrimes function.)


All times are UTC. The time now is 22:56.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.