cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A193142 Primes which are the sum of 5 distinct positive squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A004434 INTERSECTION A000040. [Charles R Greathouse IV, Jul 17 2011]

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

Formula

Conjecture: a(n) = prime(n+32) for n > 13. [Charles R Greathouse IV, Jul 17 2011]