A131974 Period 8: repeat [1, 2, 3, 4, -5, -4, -3, -2].
1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2, 1, 2, 3, 4, -5, -4, -3, -2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).
Programs
-
Mathematica
CoefficientList[Series[(1 + 2*x + 3*x^2 + 4*x^3 - 5*x^4 - 4*x^5 - 3*x^6 - 2*x^7)/(1 - x^8), {x, 0, 80}], x] (* Wesley Ivan Hurt, Aug 31 2019 *) PadRight[{},120,{1,2,3,4,-5,-4,-3,-2}] (* Harvey P. Dale, Aug 10 2022 *)
-
PARI
a(n)=[1,2,3,4,-5,-4,-3,-2][n%8+1] \\ Charles R Greathouse IV, Jun 02 2011
Formula
G.f.: (1 + 2*x + 3*x^2 + 4*x^3 - 5*x^4 - 4*x^5 - 3*x^6 - 2*x^7)/(1-x^8). - Wesley Ivan Hurt, Aug 31 2019
a(n) = a(n-8). - Wesley Ivan Hurt, Nov 28 2021