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.

A105970 Number of ordered integral solutions of Descartes' equation 2(a^2 + b^2 + c^2 + d^2) = (a + b + c + d)^2 with a + b + c + d = 4n - 2.

Original entry on oeis.org

1, 2, 1, 2, 4, 4, 3, 4, 5, 6, 8, 6, 5, 10, 7, 8, 14, 8, 9, 12, 11, 12, 12, 12, 14, 18, 13, 12, 22, 16, 15, 24, 12, 18, 24, 18, 19, 20, 24, 20, 28, 22, 16, 28, 23, 24, 32, 20, 25, 38
Offset: 1

Views

Author

Colin Mallows, Apr 28 2005

Keywords

Comments

This count includes only primitive quadruples, i.e., with gcd=1. There may also be nonprimitive quads, e.g., with n=5, 4n-2=18, we have 4 primitive quads (-1,2,6,11), (-2,3,7,10), (1,1,4,12), (-3,5,8,8) and also the nonprimitive (0,3,3,12) and (3,6,6,9). - Colin Mallows, May 11 2005

Examples

			a(5) = 4 because we have the quadruples (1,1,4,12), (-1,2,6,11), (-2,3,7,10), (3,5,8,8).
		

Crossrefs

Cf. A045864.

Programs

  • Mathematica
    r[n_] := Reduce[a <= b <= c <= d && 2 (a^2 + b^2 + c^2 + d^2) == (a + b + c + d)^2 && a + b + c + d == 4 n - 2, {a, b, c, d}, Integers];
    a[n_] := Count[{a, b, c, d} /. {ToRules[r[n]]}, sol_ /; GCD @@ sol == 1];
    Reap[Do[an = a[n]; Print[n, " ", an]; Sow[an], {n, 1, 50}]][[2, 1]] (* Jean-François Alcover, Dec 14 2018 *)

Extensions

More terms from Colin Mallows, May 11 2005