OFFSET
1,2
COMMENTS
Inverse of A073846. - Chayim Lowen, Oct 28 2015
FORMULA
a(n) = (4*pi(n)-2*n-1)*(pi(n)-pi(n-1)) + 2*(n - pi(n-1)) - 1, where pi = A000720. - Robert Israel, Oct 28 2015
MAPLE
A073898 :=proc(nmax) local a, n, k; a := [1] ; while nops(a) < nmax do n := nops(a)+1 ; if isprime(n) then k :=2; else k :=1; fi ; while k in a do k := k+2 ; od ; a := [op(a), k] ; od ; RETURN(a) ; end: op(A073898(80)) ; # R. J. Mathar, Jun 27 2007
MATHEMATICA
Table[(4 PrimePi[n] - 2 n - 1)*(PrimePi[n] - PrimePi[n - 1]) + 2 (n - PrimePi[n - 1]) - 1, {n, 72}] (* Michael De Vlieger, Nov 11 2015 *)
PROG
(PARI) vector(100, n, (4*primepi(n)-2*n-1)*(primepi(n)-primepi(n-1))+2*(n-primepi(n-1))-1) \\ Altug Alkan, Oct 29 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Aug 18 2002
EXTENSIONS
Corrected and extended by R. J. Mathar, Jun 27 2007
STATUS
approved