OFFSET
1,3
LINKS
David Lovler, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = 9*n - a(n-1) - 17 (with a(1)=0). - Vincenzo Librandi, Nov 16 2010
From R. J. Mathar, Oct 08 2011: (Start)
a(n) = 9*n/2 - 25/4 - 7*(-1)^n/4.
G.f.: x^2*(1+8*x)/( (1+x)*(1-x)^2 ). (End)
E.g.f.: 8 + ((18*x - 25)*exp(x) - 7*exp(-x))/4. - David Lovler, Sep 03 2022
EXAMPLE
13 is 1101 in base 2, so a(13+1) = a(14) = 36*1 + 18*1 + 9*0 + 1*1 = 36+18+1 = 55. - Philippe Deléham, Oct 17 2011
PROG
(PARI) forstep(n=0, 200, [1, 8], print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Giovanni Teofilatto, Feb 25 2004
STATUS
approved