[go: up one dir, main page]

login
A007667
The sum of both two and three consecutive squares.
(Formerly M4037)
8
5, 365, 35645, 3492725, 342251285, 33537133085, 3286296790925, 322023548377445, 31555021444198565, 3092070077983081805, 302991312620897818205, 29690056566770003102165
OFFSET
1,1
REFERENCES
M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 22.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
FORMULA
From Ignacio Larrosa CaƱestro, Feb 27 2000: (Start)
a(n) = (b(n)-1)^2 + b(n)^2 + (b(n)+1)^2 = c(n)^2 + (c(n)+1)^2, where b(n) = A054320(n) and c(n) = A031138(n).
a(n) = 3*A006061(n) + 2.
a(n) = 99*(a(n-1) - a(n-2)) + a(n-3).
a(n) = 3*(5 - 2*sqrt(6))/8*(sqrt(3) + sqrt(2))^(4*n) + 3*(5 + 2*sqrt(6))/8*(sqrt(3) - sqrt(2))^(4*n) + 5/4. (End)
G.f.: 5*x*(1-26*x+x^2)/((1-x)*(1-98*x+x^2)). - Colin Barker, Apr 14 2012
EXAMPLE
a(2) = 365 = 13^2+14^2 = 10^2+11^2+12^2.
MATHEMATICA
CoefficientList[Series[5*(1-26*x+x^2)/((1-x)*(1-98*x+x^2)), {x, 0, 20}], x] (* Vincenzo Librandi, Apr 16 2012 *)
PROG
(PARI) my(x='x+O('x^20)); Vec(5*x*(1-26*x+x^2)/((1-x)*(1-98*x+x^2))) \\ G. C. Greubel, Jul 23 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 20); Coefficients(R!( 5*x*(1-26*x+x^2)/((1-x)*(1-98*x+x^2)) )); // G. C. Greubel, Jul 23 2019
(Sage) (5*x*(1-26*x+x^2)/((1-x)*(1-98*x+x^2))).series(x, 20).coefficients(x, sparse=False) # G. C. Greubel, Jul 23 2019
(GAP) a:=[5, 365, 35645];; for n in [4..20] do a[n]:=99*a[n-1]-99*a[n-2] + a[n-3]; od; a; # G. C. Greubel, Jul 23 2019
CROSSREFS
KEYWORD
nonn,easy
EXTENSIONS
Corrected by T. D. Noe, Nov 07 2006
STATUS
approved