OFFSET
2,1
COMMENTS
A similar sequence is A100559. There the minimum prime is considered without any constraints on the set of squares. In fact for n=14 the smallest prime is 1171 that corresponds to the sum of the squares of 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, where the greatest number is 16. Instead in A224498 the minimum prime is 1231 coming from the sum of the squares of 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, where the maximum number is 15 < 16.
LINKS
Paolo P. Lava, Table of n, a(n) for n = 2..387
EXAMPLE
n=2 -> 1^2 + 2^2 = 5.
n=3 -> 2^2 + 3^2 + 4^2 = 29.
n=4 -> 1^2 + 3^2 + 5^2 + 6^2 = 71.
MAPLE
with(numtheory); with(combinat);
List224498:=proc(q) local a, b, d, f, g, i, j, k, ok, n;
for n from 2 to q do a:={}; for j from 1 to n do a:=a union {j}; od; ok:=1; j:=j-1;
while ok=1 do b:=choose(a, n); f:=infinity; g:={};
for i from 1 to nops(b) do d:=add((b[i][k])^2, k=1..n);
if isprime(d) then ok:=0; if d<f then f:=d; g:=b[i]; fi; fi; od;
if ok=1 then j:=j+1; a:=a union {j}; else print(f); #print(g);
# above print command may be uncommented to show the sum that produces the prime.
fi; od; od; end:
List224498(500);
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Apr 08 2013
STATUS
approved