OFFSET
1,1
COMMENTS
If n is of the form 8k + 7 and n = a^2 + b^2 + c^2 + d^2 where [a, b, c, d] has gap pattern 122, then [a, b, c, d] = [3, 5, 6, 7] + [4*i, 4*i, 4*i, 4*i], i >= 0.
LINKS
Walter Kehowski, Table of n, a(n) for n = 1..20737
J. Owen Sizemore, Lagrange's Four Square Theorem
R. C. Vaughan, Lagrange's Four Square Theorem
Eric Weisstein's World of Mathematics, Lagrange's Four-Square Theorem
Wikipedia, Lagrange's four-square theorem
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 64*n^2 + 40*n + 15.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Colin Barker, Jun 09 2014
G.f.: -x*(15*x^2-6*x+119) / (x-1)^3. - Colin Barker, Jun 09 2014
EXAMPLE
a(5) = 64*5^2 + 40*5 + 15 = 1815 and 4*5 - 1 = 19 so 1815 = 19^2 + 21^2 + 22^2 + 23^2.
MAPLE
A243581 := proc(n::posint) return 64*n^2+40*n+15 end;
MATHEMATICA
Table[64n^2 + 40n + 15, {n, 50}] (* Alonso del Arte, Jun 08 2014 *)
LinearRecurrence[{3, -3, 1}, {119, 351, 711}, 50] (* Harvey P. Dale, Jul 23 2014 *)
PROG
(PARI) Vec(-x*(15*x^2-6*x+119)/(x-1)^3 + O(x^100)) \\ Colin Barker, Jun 09 2014
(Magma) [ 64*n^2 + 40*n + 15 : n in [1..50] ]; // Wesley Ivan Hurt, Jun 11 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Walter Kehowski, Jun 08 2014
STATUS
approved