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.

A279319 Period 16 zigzag sequence: repeat [0,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1].

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5
Offset: 0

Views

Author

Wesley Ivan Hurt, Dec 09 2016

Keywords

Comments

Decimal expansion of 11111111/900000009. - Elmo R. Oliveira, Feb 20 2024

Crossrefs

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

Programs

  • Magma
    &cat[[0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1]: n in [0..5]];
    
  • Mathematica
    PadRight[{}, 120, {0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1}] (* Vincenzo Librandi, Dec 10 2016 *)
    With[{k = 16}, Table[Min[Abs[# - k], #] &@ Mod[n, k], {n, 0, 120}]] (* or *)
    CoefficientList[Series[x (1 + x) (1 + x^2) (1 + x^4)/((1 - x) (1 + x^8)), {x, 0, 120}], x] (* Michael De Vlieger, Dec 10 2016 *)
  • Python
    def A279319(n): return (0,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1)[n&15] # Chai Wah Wu, Mar 02 2023

Formula

a(n) = abs(n - 16*round(n/16)).
G.f.: x*(1 + x)*(1 + x^2)*(1 + x^4)/((1 - x)*(1 + x^8)). - Ilya Gutkovskiy, Dec 10 2016
a(n) = a(n-1)-a(n-8)+a(n-9). - Wesley Ivan Hurt, Nov 18 2021
a(n) = a(n-16) for n >= 16. - Wesley Ivan Hurt, Sep 07 2022