|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|