login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
OFFSET
1,1
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
Sequence in context: A305659 A008351 A037743 * A131698 A163068 A109684
KEYWORD
nonn,base,easy
STATUS
approved