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.

A177704 Period 4: repeat [1, 1, 1, 2].

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, May 11 2010

Keywords

Comments

Continued fraction expansion of (3 + 2*sqrt(6))/5.
Decimal expansion of 1112/9999.
a(n) = A164115(n + 1) = (-1)^(n + 1) * A164117(n + 1) = A138191(n + 3) = A107453(n + 5).

Crossrefs

Programs

  • Magma
    &cat[ [1, 1, 1, 2]: k in [1..27] ];
    
  • Maple
    A177704:=n->floor((n+1)*5/4) - floor(n*5/4): seq(A177704(n), n=0..100); # Wesley Ivan Hurt, Jun 15 2016
  • Mathematica
    Table[Floor[(n + 1)*5/4] - Floor[n*5/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 15 2016 *)
    LinearRecurrence[{0, 0, 0, 1}, {1, 1, 1, 2}, 100] (* Vincenzo Librandi, Jun 16 2016 *)
  • PARI
    a(n) = if(n%4==3, 2, 1) \\ Felix Fröhlich, Jun 15 2016

Formula

a(n) = (5-(-1)^n + i*i^n-i*(-i)^n)/4 where i = sqrt(-1).
a(n) = a(n-4) for n > 3; a(0) = 1, a(1) = 1, a(2) = 1, a(3) = 2.
G.f.: (1+x+x^2+2*x^3)/(1-x^4).
a(n) = 1 + (1-(-1)^n) * (1+i^(n+1))/4 where i = sqrt(-1). - Bruno Berselli, Apr 05 2011
a(n) = 5/4 - sin(Pi*n/2)/2 - (-1)^n/4. - R. J. Mathar, Oct 08 2011
a(n) = floor((n+1)*5/4) - floor(n*5/4). - Hailey R. Olafson, Jul 23 2014
From Wesley Ivan Hurt, Jun 15 2016: (Start)
a(n+3) - a(n+2) = A219977(n).
Sum_{i=0..n-1} a(i) = A001068(n). (End)
E.g.f.: (-sin(x) + 3*sinh(x) + 2*cosh(x))/2. - Ilya Gutkovskiy, Jun 15 2016