OFFSET
1,1
COMMENTS
Such primes must be == 1 mod 4. All the terms of the sequence are of the form 4*k+2.
EXAMPLE
46 = 1^2+2^2+5^2+4^2 = 5+41 = 17+29
102 = 3^2+2^2+5^2+8^2 = 13+89 = 73+29
MATHEMATICA
t = Partition[ Flatten[ Table[{a^2 + b^2 + c^2 + d^2, a^2, b^2, c^2, d^2}, {d, 4, 20}, {c, 3, d - 1}, {b, 2, c - 1}, {a, b - 1}]], 5]; lst = {}; lg = Length[t]; Do[a = t[[n, 2]]; b = t[[n, 3]]; c = t[[n, 4]]; d = t[[n, 5]]; If[ Drop[ Sort[ Join[ {Mod[a + b, 4] == 1 && Mod[c + d, 4] == 1 && PrimeQ[a + b] && PrimeQ[c + d]}, {Mod[a + c, 4] == 1 && Mod[b + d, 4] == 1 && PrimeQ[a + c] && PrimeQ[b + d]}, {Mod[a + d, 4] == 1 && Mod[b + c, 4] == 1 && PrimeQ[a + d] && PrimeQ[b + c]}]], 1] == {True, True}, AppendTo[ lst, t[[n, 1]] ]], {n, lg}]; Take[ Union[ lst], 52] (* Robert G. Wilson v, Mar 25 2005 *)
apQ[{a_, b_, c_, d_}]:=AllTrue[{a+b, c+d, a+d, b+c}, PrimeQ]; Total/@Select[ Flatten[ Permutations/@Subsets[Range[20]^2, {4}], 1], apQ]//Union (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 22 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robin Garcia, Mar 20 2005
EXTENSIONS
Edited by Don Reble and Robert G. Wilson v, Mar 25 2005
STATUS
approved