OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..1000
FORMULA
Conjecture: a(n) = prime(n+32) for n > 13. [Charles R Greathouse IV, Jul 17 2011]
EXAMPLE
79=1^2+2^2+3^2+4^2+7^2, 103=2^2+3^2+4^2+5^2+7^2, 127=1^2+2^2+3^2+7^2+8^2.
MATHEMATICA
lst = {}; Do[Do[Do[Do[Do[p = a^2 + b^2 + c^2 + d^2 + e^2; If[PrimeQ[p], AppendTo[lst, p]], {e, d - 1, 1, -1}], {d, c - 1, 1, -1}], {c, b - 1, 1, -1}], {b, a - 1, 1, -1}], {a, 6, 20}]; OEISTrim[Take[Union[lst], 80]]
With[{upto=500}, Select[Union[Total/@Subsets[Range[Ceiling[Sqrt[upto-30]]]^2, {5}]], PrimeQ[#]&&#<=upto&]] (* Harvey P. Dale, Jun 05 2016 *)
PROG
(PARI) upto(lim)=my(v=List(), tb, tc, td, te); for(a=6, sqrt(lim), for(b=4, min(a-1, sqrt(lim-a^2)), tb=a^2+b^2; for(c=3, min(b-1, sqrt(lim-tb)), tc=tb+c^2; for(d=2, min(c-1, sqrt(lim-tc)), td=tc+d^2; forstep(e=1+td%2, d-1, 2, te=td+e^2; if(te>lim, break); if(isprime(te), listput(v, te))))))); vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Jul 17 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jul 16 2011
STATUS
approved