OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..4000
Chris Caldwell and G. L. Honaker, Jr., Prime Curios!
EXAMPLE
The first four terms of the sequence are 5, 7, 17, 19. The sum of any three is prime: 5 + 7 + 17 = 29, 5 + 7 + 19 = 31, 5 + 17 + 19 = 41, 7 + 17 + 19 = 43. This set of four primes has the smallest possible sum, 48, and is unique.
There are two such sets of four primes with sum 72: {5, 11, 13, 43} and {11, 13, 19, 29}. The first set is listed first since it is lexicographically earliest.
MATHEMATICA
MaxSum = 100; nn = PrimePi[MaxSum - 15]; ps = {}; Do[p = Prime[{a, b, c, d}]; If[Total[p] <= MaxSum, AppendTo[ps, p]], {a, 2, nn - 3}, {b, a + 1, nn - 2}, {c, b + 1, nn - 1}, {d, c + 1, nn}]; s = Select[ps, And @@ PrimeQ /@ (Total[#] - #) &]; s2 = SortBy[s, Total]; Flatten[s2] (* T. D. Noe, Apr 01 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
G. L. Honaker, Jr., Mar 30 2013
STATUS
approved