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.

A369854 a(n) = number of nonempty subsets S of {1,2,...,n} such that (number of nonprimes in S) = (number of primes in S).

Original entry on oeis.org

0, 0, 1, 2, 5, 9, 19, 34, 69, 125, 209, 461, 791, 1715, 3002, 5004, 8007, 19447, 31823, 75581, 125969, 203489, 319769, 817189, 1307503, 2042974, 3124549, 4686824, 6906899, 20030009, 30045014, 84672314, 129024479, 193536719, 286097759, 417225899, 600805295
Offset: 0

Views

Author

Clark Kimberling, Feb 03 2024

Keywords

Examples

			a(5) = 9 counts these subsets: {1,2}, {1,3}, {1,5}, {2,4}, {3,4}, {4,5}, {1,2,3,4}, {1,2,4,5}, {1,3,4,5}.
		

Crossrefs

Programs

  • Maple
    a:= n-> binomial(n, numtheory[pi](n))-1:
    seq(a(n), n=0..36);  # Alois P. Heinz, Feb 03 2024
  • Mathematica
    Map[Length[Select[Map[Commonest, PrimeQ[Rest[Subsets[Range[#]]]]], # == {False, True} || # == {True, False} &]] &, Range[22]]  (* Peter J. C. Moses, Jan 29 2024 *)

Formula

a(n) = A369781(n) - A369853(n).
a(n) = A037031(n) - 1 = binomial(n,pi(n)) - 1. - Alois P. Heinz, Feb 03 2024

Extensions

a(23)-a(36) from Alois P. Heinz, Feb 03 2024