OFFSET
1,1
COMMENTS
If n is of the form 8k+7 and n = a^2+b^2+c^2+d^2 with gap pattern 221, then [a,b,c,d] = [1,3,5,6]+[4*i,4*i,4*i,4*i] for 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-8*n+15.
From Colin Barker, Sep 13 2015: (Start)
a(n) = 3*a(n-1)-3*a(n-2)+a(n-3) for n>3.
G.f.: x*(15*x^2+42*x+71) / (1-x)^3. (End)
EXAMPLE
a(5) = 64*5^2-8*5+15 = 1575 and m = 4*5-3 = 17 so 1575 = 17^2+19^2+21^2+22^2.
MAPLE
A243579 := proc(n::posint) return 64*n^2-8*n+15 end;
PROG
(PARI) Vec(-x*(15*x^2+42*x+71)/(x-1)^3 + O(x^100)) \\ Colin Barker, Sep 13 2015
(Magma) [64*n^2-8*n+15 : n in [1..50]]; // Wesley Ivan Hurt, Nov 28 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Walter Kehowski, Jun 08 2014
STATUS
approved