%I M4037 #53 Feb 22 2023 12:34:58
%S 5,365,35645,3492725,342251285,33537133085,3286296790925,
%T 322023548377445,31555021444198565,3092070077983081805,
%U 302991312620897818205,29690056566770003102165
%N The sum of both two and three consecutive squares.
%D M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 22.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Vincenzo Librandi, <a href="/A007667/b007667.txt">Table of n, a(n) for n = 1..500</a>
%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (99,-99,1).
%F From _Ignacio Larrosa CaƱestro_, Feb 27 2000: (Start)
%F 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).
%F a(n) = 3*A006061(n) + 2.
%F a(n) = 99*(a(n-1) - a(n-2)) + a(n-3).
%F 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)
%F G.f.: 5*x*(1-26*x+x^2)/((1-x)*(1-98*x+x^2)). - _Colin Barker_, Apr 14 2012
%e a(2) = 365 = 13^2+14^2 = 10^2+11^2+12^2.
%t CoefficientList[Series[5*(1-26*x+x^2)/((1-x)*(1-98*x+x^2)),{x,0,20}],x] (* _Vincenzo Librandi_, Apr 16 2012 *)
%o (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
%o (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
%o (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
%o (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
%Y Cf. A003154, A031138, A006061, A054320.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, _Robert G. Wilson v_
%E Corrected by _T. D. Noe_, Nov 07 2006
|