login
A037551
Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 1,2,2.
0
1, 12, 122, 1221, 12212, 122122, 1221221, 12212212, 122122122, 1221221221, 12212212212, 122122122122, 1221221221221, 12212212212212, 122122122122122, 1221221221221221
OFFSET
1,2
FORMULA
G.f.: x*(1+2*x+2*x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - R. J. Mathar, Aug 12 2013
a(1)=1, a(2)=12, a(3)=122, a(4)=1221, a(n) = 10*a(n-1) + a(n-3) - 10*a(n-4). - Harvey P. Dale, Jan 20 2015
MATHEMATICA
With[{nn=20}, Table[FromDigits[PadRight[{}, n, {1, 2, 2}]], {n, nn}]] (* or *) LinearRecurrence[{10, 0, 1, -10}, {1, 12, 122, 1221}, 20] (* Harvey P. Dale, Jan 20 2015 *)
PROG
(PARI) Vec(x*(1+2*x+2*x^2)/((x-1)*(10*x-1)*(1+x+x^2)) + O(x^25)) \\ Jinyuan Wang, Apr 14 2020
CROSSREFS
Sequence in context: A231869 A038490 A329360 * A134584 A090843 A132927
KEYWORD
nonn,base,easy
STATUS
approved