A042974 n 1's followed by a 2.
1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Examples
1.211211121111211111211111121111111211111111211111111121111111111211111...
Links
- Harry J. Smith, Table of n, a(n) for n = 1..20000
- C. V. Eynden, Problem 10439. An irrational mimic of 1/9, Amer. Math. Monthly, 104 (1997), 873.
- G. Xiao, Contfrac
- Index entries for continued fractions for constants
Programs
-
Haskell
a042974 n = a042974_list !! (n-1) a042974_list = 1 : 2 : concat (zipWith replicate (tail a042974_list) a042974_list) -- Reinhard Zumkeller, Dec 08 2011
-
Mathematica
Table[PadLeft[{2},n,1],{n,2,20}]//Flatten (* Harvey P. Dale, Sep 11 2019 *)
-
PARI
{a(n) = 1 + issquare(9 + 8*n)}; /* Michael Somos, Jan 12 2000 */
-
PARI
{ default(realprecision, 20080); x=0; for (n=1, 20000, x=10*x + 1 + issquare(9+8*n)); x/=10^19999; for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b042974.txt", n, " ", d)); } \\ Harry J. Smith, May 08 2009
-
PARI
sum(k=1,sqrtint(8*default(realprecision)+9),10^-(2*k-1)^2, 1/9.) \\ Charles R Greathouse IV, Feb 05 2025
Comments