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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

0, 1, 2, 3, 10, 15, 41, 63, 162, 381, 847, 1485, 3301, 5811, 12910, 27823, 58650, 109293, 230963, 430103, 910595, 1898711, 3913703, 7507637, 15505589, 31746650, 64574876, 130712028, 263644132, 520381365, 1050777736, 2071510458, 4187373082, 8439258405, 16971077851
Offset: 0

Views

Author

Clark Kimberling, Feb 03 2024

Keywords

Examples

			a(4) = 10 enumerates these subsets: {1}, {4}, {1,2}, {1,3}, {1,4}, {2,4}, {3,4}, {1,3,4}, {1,2,4}, {1,2,3,4}.
		

Crossrefs

Programs

  • Mathematica
    Map[Length[Select[Map[Commonest, PrimeQ[Rest[Subsets[Range[#]]]]], # != {True} &]] &, Range[22]] (* Peter J. C. Moses, Jan 29 2024 *)

Formula

a(n) + A369780(n) = 2^n-1 = A369853(n) + A369854(n).

Extensions

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

A369853 a(n) = number of subsets of {1,2,...,n} that contain more nonprimes than primes.

Original entry on oeis.org

0, 1, 1, 1, 5, 6, 22, 29, 93, 256, 638, 1024, 2510, 4096, 9908, 22819, 50643, 89846, 199140, 354522, 784626, 1695222, 3593934, 6690448, 14198086, 29703676, 61450327, 126025204, 256737233, 500351356, 1020732722, 1986838144, 4058348603, 8245721686, 16684980092
Offset: 0

Views

Author

Clark Kimberling, Feb 03 2024

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, `if`(t<0, 1, 0),
          b(n-1, t)+b(n-1, t+`if`(isprime(n), 1, -1)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..34);  # 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) - A369854(n).

Extensions

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

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
Showing 1-3 of 3 results.