A243577 Integers of the form 8k+7 that can be written as a sum of four distinct 'almost consecutive' squares.
39, 71, 87, 119, 191, 255, 287, 351, 471, 567, 615, 711, 879, 1007, 1071, 1199, 1415, 1575, 1655, 1815, 2079, 2271, 2367, 2559, 2871, 3095, 3207, 3431, 3791, 4047, 4175, 4431, 4839, 5127, 5271, 5559, 6015, 6335, 6495, 6815, 7319, 7671, 7847, 8199, 8751, 9135, 9327, 9711
Offset: 1
Examples
For n=1, a(n) = 4*1^2 + 14*1 + 21 = 39 and 39 = 1^2 + 2^2 + 3^2 + 5^2. For n=2, a(n) = 4*2^2 + 14*2 + 27 = 39 and 71 = 1^2 + 3^2 + 5^2 + 6^2. For n=3, a(n) = 4*3^2 + 10*3 + 21 = 87 and 87 = 2^2 + 3^2 + 5^2 + 7^2. For n=4, a(n) = 4*4^2 + 10*4 + 15 = 119 and 119 = 3^2 + 5^2 + 6^2 + 7^2.
Links
- Walter Kehowski, Table of n, a(n) for n = 1..1728
- J. O. 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,-5,7,-7,5,-3,1).
Programs
-
Maple
A243577 := proc(n::posint) if n mod 4 = 1 then return [4*n^2+14*n+21, [n,n+1,n+2,n+4]] elif n mod 4 = 2 then return [4*n^2+14*n+27, [n-1,n+1,n+3,n+4]] elif n mod 4 = 3 then return [4*n^2+10*n+21, [n-1,n,n+2,n+4]] else return [4*n^2+10*n+15, [n-1,n+1,n+2,n+3]] fi; end: # Walter A. Kehowski, Jun 08 2014
-
Mathematica
Rest@ CoefficientList[Series[-x (15 x^6 - 30 x^5 + 45 x^4 - 60 x^3 + 69 x^2 - 46 x + 39)/((x - 1)^3*(x^2 + 1)^2), {x, 0, 48}], x] (* Michael De Vlieger, Feb 19 2019 *) LinearRecurrence[{3,-5,7,-7,5,-3,1},{39,71,87,119,191,255,287},50] (* Harvey P. Dale, Jul 05 2021 *)
-
PARI
Vec(-x*(15*x^6-30*x^5+45*x^4-60*x^3+69*x^2-46*x+39)/((x-1)^3*(x^2+1)^2) + O(x^100)) \\ Colin Barker, Jun 09 2014
Formula
If n mod 4 = 1, then a(n) = 4*n^2 + 14*n + 21.
If n mod 4 = 2, then a(n) = 4*n^2 + 14*n + 27.
If n mod 4 = 3, then a(n) = 4*n^2 + 10*n + 21.
If n mod 4 = 0, then a(n) = 4*n^2 + 10*n + 15.
a(n) = -3*(-7 + (-i)^n+i^n) - (1-i)*((-6-6*i) + (-i)^n + i*i^n)*n + 4*n^2 where i=sqrt(-1). - Colin Barker, Jun 09 2014
G.f.: -x*(15*x^6 - 30*x^5 + 45*x^4 - 60*x^3 + 69*x^2 - 46*x + 39) / ((x-1)^3*(x^2+1)^2). - Colin Barker, Jun 09 2014
Comments