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.

A260686 Period 6 zigzag sequence, repeat [0, 1, 2, 3, 2, 1].

Original entry on oeis.org

0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1
Offset: 0

Views

Author

Wesley Ivan Hurt, Nov 15 2015

Keywords

Comments

Decimal expansion of 37/3003. - Elmo R. Oliveira, Mar 06 2024

Crossrefs

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

Programs

  • Magma
    [1+(1-(-1)^n)/2-(-1)^Floor((n+1)/3): n in [0..100]]; // Bruno Berselli, Nov 16 2015
    
  • Magma
    &cat[[0,1,2,3,2,1]: n in [0..15]]; // Vincenzo Librandi, Nov 17 2015
  • Maple
    A260686:=n->[0, 1, 2, 3, 2, 1][(n mod 6)+1]: seq(A260686(n), n=0..100);
  • Mathematica
    CoefficientList[Series[(x + x^2 + x^3)/(1 - x + x^3 - x^4), {x, 0, 100}], x]
    Table[1 + (1 - (-1)^n)/2 - (-1)^Floor[(n + 1)/3], {n, 0, 100}] (* Bruno Berselli, Nov 16 2015 *)
    PadRight[{}, 120, {0, 1, 2, 3, 2, 1}] (* Vincenzo Librandi, Nov 17 2015 *)
  • PARI
    concat(0, Vec((x+x^2+x^3)/(1-x+x^3-x^4) + O(x^100))) \\ Altug Alkan, Nov 15 2015
    

Formula

G.f.: x*(1 + x + x^2) / (1 - x + x^3 - x^4).
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3.
a(n) = Sum_{i=1..n} (-1)^floor((i-1)/3) for n > 0.
a(n+1) = a(n) + A130151(n).
a(2n) = 2*A011655(n), a(2n+1) = A109007(n+2).
a(n) = 1 + (1 - (-1)^n)/2 - (-1)^floor((n+1)/3). - Bruno Berselli, Nov 16 2015
a(n) = sin(n*Pi/6)^2*(11+4*cos(n*Pi/3)+2*cos(2*n*Pi/3))/3. - Wesley Ivan Hurt, Jun 17 2016
a(n) = a(n-6) for n >= 6. - Wesley Ivan Hurt, Sep 07 2022
a(n) = sqrt(n^2 mod 12) = sqrt(A070435(n)). - Nicolas Bělohoubek, May 24 2024