(Translated by https://www.hiragana.jp/)
A131870 - OEIS
login
A131870
Period 8: repeat [1, 2, 3, 4, 6, 7, 8, 9].
0
1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1, 2, 3, 4, 6, 7, 8, 9, 1
OFFSET
0,2
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
Cf. A071789.
Sequence in context: A372429 A366429 A071789 * A004724 A099260 A231237
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 05 2007
STATUS
approved