|
|
A037575
|
|
Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,1,2.
|
|
2
|
|
|
2, 21, 212, 2122, 21221, 212212, 2122122, 21221221, 212212212, 2122122122, 21221221221, 212212212212, 2122122122122, 21221221221221, 212212212212212, 2122122122122122
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*(2+x+2*x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - R. J. Mathar, Nov 21 2011
|
|
MATHEMATICA
|
LinearRecurrence[{10, 0, 1, -10}, {2, 21, 212, 2122}, 30] (* or *) Table[ FromDigits[ PadRight[{}, n, {2, 1, 2}]], {n, 30}] (* Harvey P. Dale, Dec 12 2014 *)
|
|
PROG
|
(PARI) Vec(x*(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
|
|
|
|