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.

A022003 Decimal expansion of 1/999.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Expansion in any base b of 1/(b^3-1). E.g., 1/7 in base 2, 1/26 in base 3, 1/63 in base 4, etc. - Franklin T. Adams-Watters, Nov 07 2006
a(n) = A130196(n) - A131534(n). - Reinhard Zumkeller, Nov 12 2009

Examples

			0.001001001001001001001...
		

Crossrefs

Essentially the same as A079978.
Cf. A068601.
Partial sums are given by A002264(n+1).

Programs

  • Mathematica
    Join[{0,0},RealDigits[1/999,10,120][[1]]] (* or *) PadRight[{},120,{0,0,1}] (* Harvey P. Dale, May 24 2012 *)
  • PARI
    a(n)=n%3==2 \\ Jaume Oliver Lafont, Mar 24 2009

Formula

From Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003: (Start)
G.f.: x^2/(1-x^3).
a(n) = -(1/2)*((-1)^floor((2n-1)/3) + (-1)^floor((2n+1)/3)). (End)
From Hieronymus Fischer, May 29 2007: (Start)
a(n) = ((n+2) mod 3) mod 2.
a(n) = (1/2)*(1 - (-1)^(n + floor((n+2)/3))). (End)
a(n) = (1 + (-1)^Fibonacci(n+1))/2. - Hieronymus Fischer, Jun 14 2007
a(n) = (n^5 - n^2) mod 3. - Gary Detlefs, Mar 20 2010
a(n) = ((-1)^(a(n-1) + a(n-2)) + 1)/2 starting from n=3. - Adriano Caroli, Nov 21 2010
a(n) = 1 - Fibonacci(n+1) mod 2. - Gary Detlefs, Dec 26 2010
a(n) = floor((n+1)/3) - floor(n/3). - Tani Akinari, Oct 22 2012