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”).
%I #13 Feb 03 2024 19:55:28
%S 0,1,1,1,5,6,22,29,93,256,638,1024,2510,4096,9908,22819,50643,89846,
%T 199140,354522,784626,1695222,3593934,6690448,14198086,29703676,
%U 61450327,126025204,256737233,500351356,1020732722,1986838144,4058348603,8245721686,16684980092
%N a(n) = number of subsets S of {1,2,...,n} such that (number of nonprimes in S) < (number of primes in S).
%H Alois P. Heinz, <a href="/A369853/b369853.txt">Table of n, a(n) for n = 0..2000</a>
%F a(n) = A369781(n) - A369854(n).
%e a(4) = 5 enumerates these subsets: {1}, {4}, {1,4}, {1,2,4}, {1,3,4}.
%p b:= proc(n, t) option remember; `if`(n=0, `if`(t<0, 1, 0),
%p b(n-1, t)+b(n-1, t+`if`(isprime(n), 1, -1)))
%p end:
%p a:= n-> b(n, 0):
%p seq(a(n), n=0..34); # _Alois P. Heinz_, Feb 03 2024
%t Map[Length[Select[Map[Commonest, PrimeQ[Rest[Subsets[Range[#]]]]], # == {False, True} || # == {True, False} &]] &, Range[22]] (* _Peter J. C. Moses_, Jan 29 2024 *)
%Y Cf. A000040, A018252, A369780, A369781, A369854.
%K nonn
%O 0,5
%A _Clark Kimberling_, Feb 03 2024
%E a(23)-a(34) from _Alois P. Heinz_, Feb 03 2024