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.

Showing 1-2 of 2 results.

A214515 Numbers of the form p^2 + q^2 + r^2 + s^2, where p, q, r, and s are primes.

Original entry on oeis.org

16, 21, 26, 31, 36, 37, 42, 47, 52, 58, 61, 63, 66, 68, 71, 76, 79, 82, 84, 87, 92, 100, 103, 106, 108, 111, 116, 124, 127, 132, 133, 138, 143, 148, 151, 154, 156, 159, 164, 172, 175, 178, 180, 181, 183, 186, 188, 191, 196, 199, 202, 204, 207, 212, 220, 223
Offset: 1

Views

Author

T. D. Noe, Jul 29 2012

Keywords

Crossrefs

Cf. A045636 (two primes), A214514 (three primes).

Programs

  • Mathematica
    nn = 10^3; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2 + ps[[k]]^2 + ps[[l]]^2, {i, Length[ps]}, {j, i, Length[ps]}, {k, j, Length[ps]}, {l, k, Length[ps]}]]; t = Select[t, # <= nn &]; Union[t]

A302359 Numbers that are the sum of 3 squares > 1.

Original entry on oeis.org

12, 17, 22, 24, 27, 29, 33, 34, 36, 38, 41, 43, 44, 45, 48, 49, 50, 54, 56, 57, 59, 61, 62, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 77, 78, 81, 82, 83, 84, 86, 88, 89, 90, 93, 94, 96, 97, 98, 99, 101, 102, 104, 105, 106, 107, 108, 109, 110, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 129
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 06 2018

Keywords

Examples

			33 is in the sequence because 33 = 2^2 + 2^2 + 5^2.
		

Crossrefs

Programs

  • Mathematica
    max = 130; f[x_] := Sum[x^(k^2), {k, 2, 20}]^3; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, max}]]
    With[{nn=15},Select[Union[Total/@Tuples[Range[2,nn]^2,3]],#<=nn^2+8&]] (* Harvey P. Dale, Jul 05 2021 *)
  • Python
    from itertools import count, takewhile, combinations_with_replacement as mc
    def aupto(N):
        sqrs = list(takewhile(lambda x: x<=N, (i**2 for i in count(2))))
        sum3 = set(sum(c) for c in mc(sqrs, 3) if sum(c) <= N)
        return sorted(sum3)
    print(aupto(129)) # Michael S. Branicky, Dec 17 2021
Showing 1-2 of 2 results.