OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(1)=1, a(2)=61; for odd n a(n) = a(n-1)+18*(n-1), for even n a(n) = a(n-1)+60*(n-1).
a(n) = (25-21*(-1)^n+6*(-13+7*(-1)^n)*n+78*n^2)/4. - Colin Barker, Apr 16 2014
G.f.: -x*(x^4+60*x^3+34*x^2+60*x+1) / ((x-1)^3*(x+1)^2). - Colin Barker, Apr 16 2014
MATHEMATICA
f[n_] := Block[{k = (6n(n + 1) + 1)/13}, If[ IntegerQ[k], k, 1]]; Union[ Table[ f[n], {n, 270}]] (* Robert G. Wilson v, May 02 2005 *)
PROG
(PARI) Vec(-x*(x^4+60*x^3+34*x^2+60*x+1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, Apr 16 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Pierre CAMI, May 01 2005
EXTENSIONS
More terms from Robert G. Wilson v, May 02 2005
STATUS
approved