The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A369854 a(n) = number of nonempty subsets S of {1,2,...,n} such that (number of nonprimes in S) = (number of primes in S). 4
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A369781(n) - A369853(n).
a(n) = A037031(n) - 1 = binomial(n,pi(n)) - 1. - Alois P. Heinz, Feb 03 2024
EXAMPLE
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}.
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 *)
CROSSREFS
Sequence in context: A073118 A048082 A089089 * A014495 A056326 A280247
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 03 2024
EXTENSIONS
a(23)-a(36) from Alois P. Heinz, Feb 03 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 09:42 EDT 2024. Contains 372683 sequences. (Running on oeis4.)