OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).
FORMULA
From Wesley Ivan Hurt, Aug 31 2019: (Start)
G.f.: (1 + 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 7*x^5 + 8*x^6 + 9*x^7)/(1-x^8).
a(n) = (1+(n mod 4))*(1+(-1)^floor(n/4))/2 + (6+((n-4) mod 4))*(1+(-1)^floor((n-4)/4))/2.
(End)
MATHEMATICA
CoefficientList[Series[(1 + 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 7*x^5 + 8*x^6 + 9*x^7)/(1 - x^8), {x, 0, 80}], x] (* Wesley Ivan Hurt, Aug 31 2019 *)
PadRight[{}, 120, {1, 2, 3, 4, 6, 7, 8, 9}] (* Harvey P. Dale, Aug 17 2021 *)
PROG
(PARI) a(n)=n=n%8; if(n>3, 2, 1)+n \\ Charles R Greathouse IV, Jul 13 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 05 2007
STATUS
approved