|
|
A037638
|
|
Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,1,3.
|
|
0
|
|
|
2, 21, 213, 2132, 21321, 213213, 2132132, 21321321, 213213213, 2132132132, 21321321321, 213213213213, 2132132132132, 21321321321321, 213213213213213, 2132132132132132
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*(2+x+3*x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - R. J. Mathar, Nov 21 2011
|
|
MATHEMATICA
|
Table[FromDigits[PadRight[{}, n, {2, 1, 3}]], {n, 20}] (* or *) LinearRecurrence[{10, 0, 1, -10}, {2, 21, 213, 2132}, 20] (* Harvey P. Dale, Jun 23 2016 *)
|
|
PROG
|
(PARI) Vec(x*(2+x+3*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
|
|
|
|