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.

A180713 If n is even then a(n) = 3n, if n == 1 mod 4 then a(n) = 3n+1, if n == 3 mod 4 then a(n) = 3n+2.

Original entry on oeis.org

0, 4, 6, 11, 12, 16, 18, 23, 24, 28, 30, 35, 36, 40, 42, 47, 48, 52, 54, 59, 60, 64, 66, 71, 72, 76, 78, 83, 84, 88, 90, 95, 96, 100, 102, 107, 108, 112, 114, 119, 120, 124, 126, 131, 132, 136, 138, 143, 144, 148, 150, 155, 156, 160, 162, 167, 168, 172, 174, 179, 180, 184, 186, 191, 192, 196, 198, 203, 204
Offset: 0

Views

Author

N. J. A. Sloane, Jan 21 2011

Keywords

Crossrefs

A variant of A006368.

Programs

  • Maple
    U:=n->if n mod 2 = 0 then 3*n elif n mod 4 = 1 then 3*n+1 else 3*n+2; fi;
  • Mathematica
    fn[n_]:=Which[EvenQ[n],3n,Mod[n,4]==1,3n+1,Mod[n,4]==3,3n+2]; Array[fn,70,0] (* Harvey P. Dale, May 03 2013 *)
    CoefficientList[Series[x (4 + 2 x + 5 x^2 + x^3) / ((1 - x) (1 - x^4)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2013 *)

Formula

From Bruno Berselli, Jan 23 2011: (Start)
G.f.: x*(4+2*x+5*x^2+x^3)/((1-x)*(1-x^4)).
a(n) = (12*n+i*(i^n-(-i)^n)-3*(-1)^n+3)/4, where i is the imaginary unit.
a(n) = A131743(n) + 3*n. (End)
a(n) = +1*a(n-1)+1*a(n-4)-1*a(n-5) for n>=5. [Joerg Arndt, Jan 25 2011]

Extensions

Definition corrected by N. J. A. Sloane, Jan 23 2011