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.

A071810 Number of subsets of the first n primes whose sum is a prime.

This page as a plain text file.
%I A071810 #30 Oct 27 2023 14:41:57
%S A071810 1,3,5,7,12,20,35,65,122,237,448,846,1629,3157,6159,12052,23484,45731,
%T A071810 89394,175742,346214,681850,1344838,2657654,5253640,10374991,20471626,
%U A071810 40401929,79871387,158182899,313402605,620776215,1228390086,2430853648
%N A071810 Number of subsets of the first n primes whose sum is a prime.
%C A071810 a(n+1) < 2*a(n) fails for n = 1, 332 and other larger values of n. - _Don Reble_, Sep 07 2006
%C A071810 Here is one way to compute this sequence. Compute f_n(x) = Product_{k=1..n} 1+x^prime(k) = f_{n-1}(x) * (1+x^prime(n)). Then sum the coefficients of x^p in f_n(x) for p prime. You only need to look at primes <= the sum of the first n primes. - _Franklin T. Adams-Watters_, Sep 07 2006
%H A071810 Alois P. Heinz, <a href="/A071810/b071810.txt">Table of n, a(n) for n = 1..1000</a> (first 100 terms from T. D. Noe)
%e A071810 a(4) = 7 because, besides the original 4 primes, the other 3 subsets, {2,3}, {2,5} & {2,3,5,7} also sum to a prime.
%t A071810 Do[ Print[ Count[ PrimeQ[Plus @@@ Subsets[ Table[ Prime[i], {i, 1, n}]]], True]], {n, 1, 22}]
%t A071810 Table[Count[Total/@Subsets[Prime[Range[n]]],_?PrimeQ],{n,20}] (* _Harvey P. Dale_, Mar 03 2020 *)
%o A071810 (Haskell)
%o A071810 import Data.List (subsequences)
%o A071810 a071810 = sum . map a010051' . map sum .
%o A071810           tail . subsequences . flip take a000040_list
%o A071810 -- _Reinhard Zumkeller_, Dec 16 2013
%Y A071810 Cf. A000341, A108018.
%Y A071810 Cf. A010051, A000040.
%K A071810 nonn,nice
%O A071810 1,2
%A A071810 _Robert G. Wilson v_, Jun 06 2002
%E A071810 More terms from _Don Reble_, Sep 07 2006
%E A071810 Edited by _N. J. A. Sloane_, Sep 08 2006