![]() |
[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. |
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.
|
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=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. |
[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. |
[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=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] |
[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] |
I love how that change in code fits exactly the range of 80-81 I predicted.
|
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: |
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.