OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,-1,2,-1).
FORMULA
G.f.: x*(5+2*x^4+6*x^3-4*x^2)/((x+1)*(x^2-x+1)*(x-1)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009; corrected by R. J. Mathar, Sep 16 2009
a(n) = (18*n - 9 + (-1)^n)/4 + 3*A128834(n). - Christian Krause, Apr 12 2026
E.g.f.: (4 + (9*x - 4)*cosh(x) + 4*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2) + (9*x - 5)*sinh(x))/2. - Stefano Spezia, Apr 12 2026
MATHEMATICA
dr[n_]:=NestWhile[Total[IntegerDigits[#]]&, n, #>9&]; NestList[#+dr[#]&, 5, 60] (* or *) LinearRecurrence[{2, -1, -1, 2, -1}, {5, 10, 11, 13, 17}, 90] (* Harvey P. Dale, Aug 15 2017 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved
