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.

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

This page as a plain text file.
%I A369780 #19 Feb 03 2024 19:49:41
%S A369780 0,0,1,4,5,16,22,64,93,130,176,562,794,2380,3473,4944,6885,21778,
%T A369780 31180,94184,137980,198440,280600,880970,1271626,1807781,2533987,
%U A369780 3505699,4791323,16489546,22964087,75973189,107594213,150676186,208791332,286454524,389329652
%N A369780 a(n) = number of subsets of {1,2,...,n} that contain more primes than nonprimes.
%H A369780 Alois P. Heinz, <a href="/A369780/b369780.txt">Table of n, a(n) for n = 0..2000</a>
%F A369780 a(n) + A369781(n) = 2^n-1.
%F A369780 a(n) = Sum_{i=1..pi(n)} Sum_{j=0..i-1} binomial(pi(n),i)*binomial(n-pi(n),j). - _Alois P. Heinz_, Feb 03 2024
%e A369780 a(4) = 5 enumerates these subsets: {2}, {3}, {2,3}, {1,2,3}, {2,3,4}.
%p A369780 b:= proc(n, t) option remember; `if`(n=0, `if`(t>0, 1, 0),
%p A369780       b(n-1, t)+b(n-1, t+`if`(isprime(n), 1, -1)))
%p A369780     end:
%p A369780 a:= n-> b(n, 0):
%p A369780 seq(a(n), n=0..36);  # _Alois P. Heinz_, Feb 03 2024
%t A369780 Map[Length[Select[Map[Commonest, PrimeQ[Rest[Subsets[Range[#]]]]], # == {True} &]] &, Range[22]]  (* _Peter J. C. Moses_, Jan 29 2024 *)
%Y A369780 Cf. A000040, A000720, A018252, A037031, A369781, A369853, A369854.
%K A369780 nonn
%O A369780 0,4
%A A369780 _Clark Kimberling_, Feb 03 2024
%E A369780 a(23)-a(36) from _Alois P. Heinz_, Feb 03 2024