A271832 Period 12 zigzag sequence: repeat [0,1,2,3,4,5,6,5,4,3,2,1].
0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,-1,1).
Crossrefs
Programs
-
Magma
&cat[[0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1]: n in [0..10]];
-
Maple
A271832:=n->[0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1][(n mod 12)+1]: seq(A271832(n), n=0..300);
-
Mathematica
CoefficientList[Series[x*(1 + x + x^2 + x^3 + x^4 + x^5)/(1 - x + x^6 - x^7), {x, 0, 100}], x]
-
PARI
lista(nn) = for(n=0, nn, print1(abs(n-12*round(n/12)), ", ")); \\ Altug Alkan, Apr 15 2016
Formula
G.f.: x*(1 + x + x^2 + x^3 + x^4 + x^5)/(1 - x + x^6 - x^7).
a(n) = a(n-1) - a(n-6) + a(n-7) for n>6.
a(n) = abs(n - 12*round(n/12)).
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/6).
a(n) = a(n-12) for n >= 12. - Wesley Ivan Hurt, Sep 07 2022
Comments