login
Number of subsets of {1,..,n} containing at least one prime.
3

%I #14 Sep 08 2022 08:45:12

%S 0,2,6,12,28,56,120,240,480,960,1984,3968,8064,16128,32256,64512,

%T 130048,260096,522240,1044480,2088960,4177920,8372224,16744448,

%U 33488896,66977792,133955584,267911168,536346624,1072693248,2146435072,4292870144,8585740288

%N Number of subsets of {1,..,n} containing at least one prime.

%C a(n) = Sum(A089818(n,k): 1<=k<=A000720(n)) = A000079(n)-A089819(n) = A089819(n)*A000225(A000720(n)).

%H Vincenzo Librandi, <a href="/A089820/b089820.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = 2^n - 2^(n-pi(n)) = the total number of subsets minus the number of subsets of the nonprime elements of {1,..,n}, where pi = A000720. - _Greg Martin_, May 13 2004

%p with(numtheory): A089820:=n->2^n - 2^(n-pi(n)): seq(A089820(n), n=1..30); # _Wesley Ivan Hurt_, Sep 19 2014

%t Table[2^n - 2^(n - PrimePi[n]), {n, 30}] (* _Wesley Ivan Hurt_, Sep 19 2014 *)

%o (Magma) [2^n-2^(n-#PrimesUpTo(n)) : n in [1..30]]; // _Wesley Ivan Hurt_, Sep 19 2014

%Y Cf. A089822.

%Y Cf. A000079, A000225, A000720, A089818, A089819.

%K nonn,easy

%O 1,2

%A _Reinhard Zumkeller_, Nov 12 2003

%E More terms from _Wesley Ivan Hurt_, Sep 19 2014