20190215, 20:55  #23  
"Dana Jacobsen"
Feb 2011
Bangkok, TH
1606_{8} Posts 
Quote:
You can view it as trial division up to the lucky number count of n (approximately n/log(n)). We generate lucky numbers only up to that (at most). For a concrete example take n = 2^23 = 8388608 and call is_lucky(n+x) for x = 1..100. There are 8 lucky numbers in the range. Only 14 of the 100 values require anything beyond looking at the first 48 lucky numbers. After that we could sieve to ~ 520000. Along the way check if the number we're interested in would be removed. Times on a Macbook in milliseconds: 2300 Time to generate lucky numbers to 2^23 12 Time to generate lucky numbers to 520000 160 Time for is_lucky(2^23+x) for x=1..100 120 Time for nth_lucky(517138+x) for x=1..8 These are measuring 100 and 8 (respectively) independent calls. If we really wanted the numbers in the sequential range we could just sieve once (to the lucky count of the max value needed). But that isn't the "is_lucky" predicate, which is usually thought of as a single call with an arbitrary integer input. Last fiddled with by danaj on 20190215 at 21:01 

20190823, 20:45  #24 
May 2018
5·37 Posts 
When are we going to try to find the next maximal lucky gap?

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Gaps between maximal prime gaps  Bobby Jacobs  Prime Gap Searches  48  20191224 10:04 
Fun with the Lucky Numbers of Euler  ewmayer  Probability & Probabilistic Number Theory  0  20151018 01:37 
Lucky ECM hit  Dubslow  Factoring  3  20141019 19:10 
Lucky gmpecm curve...  WraithX  GMPECM  4  20090112 16:29 
Gaps and more gaps on <300 site  gd_barnes  Riesel Prime Search  11  20070627 04:12 