OFFSET
3,2
EXAMPLE
From Petros Hadjicostas, Nov 19 2019: (Start)
The first 3 primes are 2, 3, and 5, and they form only one sum, so a(4) = 1.
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.
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.
(End)
MAPLE
f := proc(n) local v, i, j, k; v := {};
if 3 <= n then
for i from 1 to n - 2 do
for j from i + 1 to n - 1 do
for k from j + 1 to n do
v := v union {ithprime(i) + ithprime(j) + ithprime(k)};
end do; end do; end do;
end if; nops(v); end proc;
seq(f(n), n=3..40); #
PROG
(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); }
for(n=3, 40, print1(a(n)", ")) \\ Petros Hadjicostas, Nov 19 2019 by modifying Michel Marcus's PARI program in A049880
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by and more terms from Petros Hadjicostas, Nov 19 2019
STATUS
approved