cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A369610 a(n) is the number of nonprime numbers < prime(n) which are not equal to twice a prime.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Jan 27 2024

Keywords

Examples

			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).
		

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = A014689(n) - A079952(n). - Jinyuan Wang, Feb 09 2024