|
|
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
|
|
|
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:
|
|
MATHEMATICA
|
Map[Length[Select[Map[Commonest, PrimeQ[Rest[Subsets[Range[#]]]]], # == {False, True} || # == {True, False} &]] &, Range[22]] (* Peter J. C. Moses, Jan 29 2024 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|