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.

A131452 a(3n)=4n, a(3n+1)=4n+2, a(3n+2)=4n+1.

Original entry on oeis.org

0, 2, 1, 4, 6, 5, 8, 10, 9, 12, 14, 13, 16, 18, 17, 20, 22, 21, 24, 26, 25, 28, 30, 29, 32, 34, 33, 36, 38, 37, 40, 42, 41, 44, 46, 45, 48, 50, 49, 52, 54, 53, 56, 58, 57, 60, 62, 61, 64, 66, 65, 68, 70, 69, 72, 74, 73, 76, 78, 77, 80, 82, 81, 84, 86, 85, 88, 90, 89, 92, 94, 93
Offset: 0

Views

Author

Paul Curtz, Oct 01 2007

Keywords

Crossrefs

Essentially partial sums of A131756.

Programs

  • Maple
    nmax:= 40: gf:= (x*(2 - x + 3*x^2))/((x - 1)^2*(1 + x + x^2)): ser:= series(gf, x, nmax + 16): seq(coeff(ser, x, i), i=0..nmax); # Georg Fischer, Nov 17 2022
  • Mathematica
    Table[Switch[Mod[n, 3], 0, 4 n/3, 1, 4 (n - 1)/3 + 2, 2, 4 (n - 2)/3 + 1], {n, 0, 71}] (* Michael De Vlieger, Sep 30 2017 *)

Formula

a(n) = (12*n-3+9*cos(2*(n-1)*Pi/3)-5*sqrt(3)*sin(2*(n-1)*Pi/3))/9. - Wesley Ivan Hurt, Sep 30 2017
G.f.: (x*(2 - x + 3*x^2))/((x - 1)^2*(1 + x + x^2)). - Georg Fischer, Nov 17 2022