OFFSET
1,1
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
Wikipedia, Bertrand's postulate (Generalizations)
FORMULA
a(n) = 1 - A175861(n).
PROG
(PARI)
up_to = 100000;
A175856list(up_to) = { my(v=vector(up_to)); for(n=1, up_to, if((1==n)||isprime(n), v[n] = n, v[n] = v[n-1] - 1)); (v); };
\\ This implementation depends on M. El Bachraoui's proof that there exists a prime between 2n and 3n for n > 1 (see Wikipedia-article).
A175860list(up_to) = { my(v=vector(up_to), A175857 = Set(A175856list(prime(2+primepi(2*up_to))))); for(n=1, up_to, v[n] = (0!=vecsearch(A175857, n))); (v); };
v175860 = A175860list(up_to);
A175860(n) = v175860[n]; \\ Antti Karttunen, Nov 08 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Sep 29 2010
STATUS
approved