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.

A021823 Decimal expansion of 1/819.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Partial sums of A010892. - Paul Barry, Jun 06 2003
Expansion in any base b >= 3 of 1/((b-1)*(b^2-b+1)) = 1/(b^3-2b^2+2b-1). E.g., 1/14 in base 3, 1/39 in base 4, 1/84 in base 5, etc. - Franklin T. Adams-Watters, Nov 07 2006
a(n) is the second least significant digit in the ternary representation of 2^n (cf. A004642). - Alexandre Herrera, Oct 09 2023

Examples

			0.0012210012210012210...
		

Crossrefs

Cf. A004642, A153130 (2^n mod 9).

Programs

  • Mathematica
    Join[{0,0},RealDigits[1/819,10,120][[1]]] (* or *) PadRight[{},120,{0,0,1,2,2,1}] (* or *) LinearRecurrence[{2,-2,1},{0,0,1},120] (* Harvey P. Dale, Aug 19 2012 *)
  • PARI
    a(n)=1/819. \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = a(n-1)-a(n-2)+1 = 2-a(n-3) = a(n-6). - Henry Bottomley, Apr 12 2000
a(n) = Sum_{k=1..floor(n/2)} (-1)^(k+1)*binomial(n-k, k) = 1-((-1)^floor(n/3)+(-1)^(floor((n+1)/3)))/2. - Vladeta Jovovic, Feb 10 2003
G.f.: x^2/(1-2x+2x^2-x^3)=x^2/((1-x)(x^2-x+1)). - Paul Barry, Jun 06 2003
a(n+2) = sum{k=0..n, binomial(n-2k, n-k)}. - Paul Barry, Jan 15 2005
a(0)=0, a(1)=0, a(2)=1, a(n)=2*a(n-1)-2*a(n-2)+a(n-3). - Harvey P. Dale, Aug 19 2012