login
A369610
a(n) is the number of nonprime numbers < prime(n) which are not equal to twice a prime.
2
1, 1, 1, 1, 3, 4, 6, 7, 9, 13, 14, 18, 20, 21, 23, 28, 32, 33, 37, 40, 41, 45, 47, 51, 57, 60, 61, 63, 64, 67, 78, 81, 85, 86, 93, 94, 99, 103, 105, 110, 114, 115, 124, 125, 127, 128, 137, 146, 148, 149, 152, 157, 158, 167, 171, 175, 180, 181, 185, 187, 188, 197, 208, 211
OFFSET
1,5
LINKS
FORMULA
a(n) = A014689(n) - A079952(n). - Jinyuan Wang, Feb 09 2024
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
STATUS
approved