login
A037567
Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,2,1.
1
2, 22, 221, 2212, 22122, 221221, 2212212, 22122122, 221221221, 2212212212, 22122122122, 221221221221, 2212212212212, 22122122122122, 221221221221221, 2212212212212212
OFFSET
1,1
FORMULA
G.f. x*(2+2*x+x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - R. J. Mathar, Nov 21 2011
(Start)
a(n) = floor(221/999 * 10^n).
a(n) = 10*a(n-1) + 1 + (n^2 mod 3).
(End) - Robert Israel, Sep 12 2014
MAPLE
seq(floor(221/999*10^n), n=1..30); # Robert Israel, Sep 12 2014
PROG
(PARI) a(n)=my(S=Str); for(i=0, n-1, S=concat(S, [2, 2, 1][i%3+1])); return(eval(S)) \\ Edward Jiang, Sep 11 2014
CROSSREFS
Sequence in context: A239688 A350965 A336894 * A174200 A137109 A002276
KEYWORD
nonn,base
STATUS
approved