Bill Allombert on Thu, 01 Feb 2024 21:14:46 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: primepi([from,until])


On Thu, Feb 01, 2024 at 09:08:00PM +0100, Ruud H.G. van Tol wrote:
> 
> I'm adding
> 
> a(n) = #primes([n^2/4, (n+1)^2/4]);
> 
> to https://oeis.org/A220492
> 
> and was wondering if primepi() should grow a primepi([x1, x2])variant,
> to return the number of primes p, x1 <= p <= x2.

just do primepi(floor(x2))- primepi(ceil(x1)-1) or something ?

PS: I have vague plans to rewrite primepi to be faster....

Cheers,
Bill