|
|
A049881
|
|
a(n) is the number of distinct sums of 3 different primes chosen from the first n primes.
|
|
3
|
|
|
1, 4, 10, 16, 23, 30, 38, 47, 57, 67, 77, 87, 96, 106, 116, 129, 140, 151, 160, 172, 183, 194, 208, 220, 231, 242, 252, 261, 279, 292, 304, 319, 334, 346, 360, 374, 389, 400, 413, 426, 440, 452, 464, 476, 488, 505, 524, 538, 552, 563, 576, 591, 604, 615, 625, 645, 659, 673, 683, 698, 716, 733
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
3,2
|
|
LINKS
|
|
|
EXAMPLE
|
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); }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|