login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A369853
a(n) = number of subsets S of {1,2,...,n} such that (number of nonprimes in S) < (number of primes in S).
4
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,5
LINKS
FORMULA
a(n) = A369781(n) - A369854(n).
EXAMPLE
a(4) = 5 enumerates these subsets: {1}, {4}, {1,4}, {1,2,4}, {1,3,4}.
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 03 2024
EXTENSIONS
a(23)-a(34) from Alois P. Heinz, Feb 03 2024
STATUS
approved