OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1).
FORMULA
a(n) = 8*(n-2) = A008590(n-2), n>1. - R. J. Mathar, Oct 18 2010
G.f.: x*(1 - 2*x + 9*x^2)/(-1 + x)^2. -Alexander R. Povolotsky, Oct 18 2010
a(1)=1, a(2)=0, a(3)=8, a(n)=2*a(n-1)-a(n-2). -Harvey P. Dale, Aug 23 2012
E.g.f.: 16 + 9*x + 8*exp(x)*(x - 2). - Stefano Spezia, Apr 03 2023
MATHEMATICA
Module[{lst={1}}, Do[AppendTo[lst, Abs[Total[lst]-n^2]], {n, 1, 111, 2}]; lst] (* or *) Join[{1}, LinearRecurrence[{2, -1}, {0, 8}, 60]] (* Harvey P. Dale, Aug 23 2012 *)
ad[{t_, n_, a_}]:=Module[{c=Abs[t-(2n-1)^2]}, {t+c, n+1, c}]; NestList[ad, {1, 1, 1}, 60][[All, 3]] (* or *) Join[{1}, NestList[8 + # &, 0, 60]] (* Harvey P. Dale, May 14 2019 *)
PROG
(PARI) a(n)=if(n>1, 8*n-8, 1) \\ Charles R Greathouse IV, Jul 31 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Giovanni Teofilatto, Oct 17 2010
EXTENSIONS
Adapted g.f. to the offset from Bruno Berselli, Aug 01 2013
STATUS
approved
