OFFSET
1,1
COMMENTS
Parity of A120941: 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, ....
LINKS
Robert Israel, Table of n, a(n) for n = 1..4000
FORMULA
EXAMPLE
The product of the 4th prime number, 7 and the 5th prime, 11, is 77; the smallest prime greater than this is the 22nd prime, 79; therefore the 4th term of the sequence is 22-4 = 18.
MAPLE
f:= n -> numtheory:-pi(ithprime(n)*ithprime(n+1))+1-n:
map(f, [$1..100]); # Robert Israel, Mar 21 2017
MATHEMATICA
Table[PrimePi[Prime[n]Prime[n + 1]] - n + 1, {n, 48}] (* Zak Seidov, Aug 21 2006 *)
PROG
(PARI) for(n=1, 100, print1(primepi(prime(n)*prime(n + 1)) - n + 1, ", ")) \\ Indranil Ghosh, Mar 22 2017
(Python)
from sympy import prime, primepi
print([primepi(prime(n)*prime(n + 1)) - n + 1 for n in range(1, 100)]) # Indranil Ghosh, Mar 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Axel Harvey, Aug 18 2006
EXTENSIONS
More terms from Robert G. Wilson v, Aug 21 2006
STATUS
approved