OFFSET
1,4
COMMENTS
First differences form A046933, which requires that for this sequence the parity of successive terms alternates.
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
EXAMPLE
a(25) = 71 since prime(25) = 97 is the 25th prime and 96 is the 71st composite number in A002808.
MATHEMATICA
CompositePi[n_Integer] := (n - PrimePi[n] - 1); Table[ CompositePi[ Prime[n]], {n, 1, 75} ]
PROG
(PARI) a(n) = { prime(n) - n - 1 } \\ Harry J. Smith, Nov 03 2009
(Magma) [NthPrime(n)-n-1: n in [1..65]]; // Vincenzo Librandi, Aug 15 2015
(Python)
from sympy import prime
def A065890(n): return prime(n)-n-1 # Chai Wah Wu, Oct 11 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer and Robert G. Wilson v, Nov 28 2001
STATUS
approved
