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.

A025367 Numbers that are the sum of 4 nonzero squares in 2 or more ways.

Original entry on oeis.org

28, 31, 34, 36, 37, 39, 42, 43, 45, 47, 49, 50, 52, 54, 55, 57, 58, 60, 61, 63, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    V:= Vector(N):
    for x from 1 while x^2 +3 <= N do
    for y from 1 to x while x^2 + y^2 + 2 <= N do
      for z from 1 to y while x^2 + y^2 + z^2 + 1 <= N do
        for w from 1 to z while x^2 + y^2 + z^2 + w^2 <= N do
           t:= x^2 + y^2 + z^2 + w^2;
           V[t]:= V[t]+1;
    od od od od:
    select(t -> V[t] >= 2, [$1..N]); # Robert Israel, Jul 05 2017
  • Mathematica
    Select[Range@ 200, 2 == Length@ Quiet@ IntegerPartitions[#, {4}, Range[Sqrt@ #]^2, 2] &] (* Giovanni Resta, Jul 05 2017 *)
    M = 1000;
    Clear[V]; V[_] = 0;
    For[a = 1, a <= Floor[Sqrt[M/4]], a++,
      For[b = a, b <= Floor[Sqrt[(M - a^2)/3]], b++,
        For[c = b, c <= Floor[Sqrt[(M - a^2 - b^2)/2]], c++,
          For[d = c, d <= Floor[Sqrt[M - a^2 - b^2 - c^2]], d++,
            m = a^2 + b^2 + c^2 + d^2;
            V[m] = V[m] + 1;
    ]]]];
    Select[Range[M], V[#] >= 2&] (* Jean-François Alcover, Mar 22 2019, after Robert Israel *)

Formula

{n: A025428(n) >= 2}. - R. J. Mathar, Jun 15 2018