OFFSET
1,2
COMMENTS
a(n+2)/a(n) tends to A156164.
a(n) is congruent to {0,2,4} (mod 5, 6 and 10).
LINKS
Bruno Berselli, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (1,34,-34,-1,1).
FORMULA
G.f.: 4*x*(1+x)^2/((1-x)*(1-6*x+x^2)*(1+6*x+x^2)).
a(n) = a(-n+1) = a(n-1)+34*a(n-2)-34*a(n-3)-a(n-4)+a(n-5).
a(n) = -1/2+((3+t*(-1)^n)*(3-2*t)^(2*floor(n/2))+(3-t*(-1)^n)*(3+2*t)^(2*floor(n/2)))/12, where t=sqrt(2).
MATHEMATICA
LinearRecurrence[{1, 34, -34, -1, 1}, {0, 4, 12, 152, 424}, 23]
CoefficientList[Series[4 x (1 + x)^2 / ((1 - x) (1 - 6 x + x^2) (1 + 6 x + x^2)), {x, 0, 25}], x] (* Vincenzo Librandi, Aug 18 2013 *)
PROG
(Magma) m:=22; R<x>:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(4*(1+x)^2/((1-x)*(1-6*x+x^2)*(1+6*x+x^2))));
(Magma) I:=[0, 4, 12, 152, 424]; [n le 5 select I[n] else Self(n-1)+34*Self(n-2)-34*Self(n-3)-Self(n-4)+Self(n-5): n in [1..25]]; // Vincenzo Librandi, Aug 18 2013
(Maxima) makelist(expand(-1/2+((3+sqrt(2)*(-1)^n)*(3-2*sqrt(2))^(2*floor(n/2))+(3-sqrt(2)*(-1)^n)*(3+2*sqrt(2))^(2*floor(n/2)))/12), n, 1, 23);
(PARI) x='x+O('x^30); concat([0], Vec(4*x*(1+x)^2/((1-x)*(1-6*x+x^2)*(1+6*x+x^2)))) \\ G. C. Greubel, Jul 15 2018
CROSSREFS
Cf. nonnegative integers n such that k*n*(n+1)+1 is a square: A001652 (k=2), A001921 (k=3), A001477 (k=4), A053606 (k=5), A105038 (k=6), A105040 (k=7), A053141 (k=8), A222390 (k=10), A105838 (k=11), A061278 (k=12), A104240 (k=13); A105063 (k=17), this sequence (k=18), A101180 (k=19), A077259 (k=20) [incomplete list].
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Feb 19 2013
STATUS
approved