cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A271832 Period 12 zigzag sequence: repeat [0,1,2,3,4,5,6,5,4,3,2,1].

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Apr 15 2016

Keywords

Comments

a(n)/36 is the probability that the sum shown after rolling a pair of standard dice is 1+(n mod 12). - Mathew Englander, Jul 11 2022
Decimal expansion of 37037/3000003. - Elmo R. Oliveira, Mar 03 2024

Crossrefs

Period k zigzag sequences: A000035 (k=2), A007877 (k=4), A260686 (k=6), A266313 (k=8), A271751 (k=10), this sequence (k=12), A279313 (k=14), A279319 (k=16), A158289 (k=18).

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(2n) = a(10n) = 2*A260686(n), a(2n+1) = A110551(n).
a(3n) = 3*A007877(n), a(4n) = a(8n) = 4*A011655(n).
a(6n) = A010677(n) = 6*A000035(n).
a(n) = a(n-12) for n >= 12. - Wesley Ivan Hurt, Sep 07 2022