OFFSET
1,5
COMMENTS
Also, a(n)=sum_{k=n-th even number..n-th odd prime together with 1}-k*(-1)^k. - Juri-Stepan Gerasimov, Jul 30 2009
FORMULA
a(n)=A008507(n-1)+1. - R. J. Mathar, Jul 06 2009
MAPLE
A129768 := proc(n) local res, p, i ; res := 0 ; p := ithprime(n) ; for i from 1 to p-1 by 2 do if not isprime(i) then res := res+1 ; fi ; od ; RETURN(res) ; end: for n from 1 to 80 do printf("%d, ", A129768(n)) ; od ; # R. J. Mathar, May 17 2007
MATHEMATICA
f[n_] := Ceiling[ Prime@n / 2] - n + 1; Array[f, 72] (* Robert G. Wilson v *)
nn=401; With[{np=Select[Range[1, nn, 2], !PrimeQ[#]&]}, Table[Count[np, _?(#<n&)], {n, Prime[Range[PrimePi[nn]]]}]] (* Harvey P. Dale, Mar 01 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Teofilatto, May 16 2007
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v and R. J. Mathar, May 16 2007
STATUS
approved