login
A193142
Primes which are the sum of 5 distinct positive squares.
3
79, 103, 127, 131, 139, 151, 157, 163, 167, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433
OFFSET
1,1
COMMENTS
A004434 INTERSECTION A000040. [Charles R Greathouse IV, Jul 17 2011]
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
STATUS
approved