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 #31 Nov 20 2019 02:30:30
%S 1,4,10,16,23,30,38,47,57,67,77,87,96,106,116,129,140,151,160,172,183,
%T 194,208,220,231,242,252,261,279,292,304,319,334,346,360,374,389,400,
%U 413,426,440,452,464,476,488,505,524,538,552,563,576,591,604,615,625,645,659,673,683,698,716,733
%N a(n) is the number of distinct sums of 3 different primes chosen from the first n primes.
%e From _Petros Hadjicostas_, Nov 19 2019: (Start)
%e The first 3 primes are 2, 3, and 5, and they form only one sum, so a(4) = 1.
%e The first 4 primes are 2, 3, 5, and 7, and they form 4 distinct sums each with three different terms (10, 12, 14, 15), so a(2) = 4.
%e The first 5 primes are 2, 3, 5, 7, and 11, and they form 13 distinct sums each with three different terms (10, 12, 14, 15, 16, 18, 19, 20, 21, 23), so a(5) = 10.
%e (End)
%p f := proc(n) local v, i, j, k; v := {};
%p if 3 <= n then
%p for i from 1 to n - 2 do
%p for j from i + 1 to n - 1 do
%p for k from j + 1 to n do
%p v := v union {ithprime(i) + ithprime(j) + ithprime(k)};
%p end do; end do; end do;
%p end if; nops(v); end proc;
%p seq(f(n), n=3..40); #
%o (PARI) a(n)={my(pr=primes(n), sums=Set()); for(i=1, n-2, for(j=i+1, n-1, for(k=j+1, n, s=pr[i]+pr[j]+pr[k]; sums=setunion(sums, Set(s)))); ); length(sums); }
%o for(n=3, 40, print1(a(n)", ")) \\ _Petros Hadjicostas_, Nov 19 2019 by modifying _Michel Marcus_'s PARI program in A049880
%Y Cf. A000040, A049880, A049882, A253250.
%K nonn
%O 3,2
%A _Clark Kimberling_
%E Name edited by and more terms from _Petros Hadjicostas_, Nov 19 2019