OFFSET
1,5
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(n) = 1 for n = 1..4 since in each case there is only one nonprime number (1) < prime(n) which is not twice a prime.
a(5) = 3 since prime(5) = 11 and there are precisely 3 nonprime numbers < 11 which are not twice a prime (1,8,9).
MATHEMATICA
nn = Prime[10^4]; c = p = 0; Reap[Do[c += 1 - Boole[PrimeQ[i/2]]; If[PrimeQ[i], p++; Sow[c - p]], {i, nn}]][[-1, 1]] (* Michael De Vlieger, Jan 27 2024 *)
PROG
(PARI) a369610(n) = {my(s=1); forcomposite (j=4, prime(n)-1, if(j%2!=0 || !isprime(j/2), s++)); s} \\ Hugo Pfoertner, Jan 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jan 27 2024
STATUS
approved