| Bill Allombert on Sun, 14 Jan 2024 12:49:53 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: Implementation of forprime() and unextprime() |
On Sat, Jan 13, 2024 at 03:37:07AM -0800, Ilya Zakharevich wrote: > > > This remark is also a tiny bit pointless without giving the HTTP url > > > to browse… ⅞ ;―] > > > > I was quite sure you could find it yourself. > > … And I was quite sure you can use my analysis of an older code! But then why should we both waste time on old code ? > > Yes, we store the product of all primes < 2^i for all i less than 20, > > which we can then use for sieving (for factor(,0)) > > > > ? for(i=1,1000,factor(random(2^1000),2^18)) > > With 2.15.4 > > *** last result computed in 1,865 ms. > > With 2.16.1 > > *** last result computed in 124 ms. > > How interesting! Thanks! > > Still, this does not explain what is so special about 20… It used to be primelimit=500000, so we could have picked 19 , but 20 (2^20~10^6) is easier to remember. Also its square is 2^40~10^12. Memory size have grown, so the extra memory requirement should not be an issue. Cheers, Bill.