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.

A357214 a(n) = number of subsets S of {1, 2, ..., n} such that every number in S is a composite.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 8, 16, 32, 32, 64, 64, 128, 256, 512, 512, 1024, 1024, 2048, 4096, 8192, 8192, 16384, 32768, 65536, 131072, 262144, 262144, 524288, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 16777216, 33554432, 67108864, 134217728, 134217728
Offset: 1

Views

Author

Clark Kimberling, Sep 24 2022

Keywords

Examples

			The subsets S of {1,2,3,4,5,6} such that every number in S is a composite are {}, {4}, {6}, and {4,6}, so a(6) = 4.
		

Crossrefs

Programs

  • Mathematica
    (1/2) Table[2^(n - PrimePi[n]), {n, 50}]
  • PARI
    a(n) = 1 << (n-primepi(n)-1); \\ Kevin Ryde, Sep 24 2022
  • Python
    from sympy import primepi
    def a(n): return 2**(n-primepi(n)-1)
    print([a(n) for n in range(1, 42)]) # Michael S. Branicky, Sep 24 2022
    

Formula

a(n) = (1/2)*(2^(n - A000720(n))).
a(n) = 2^A065855(n).