%I #32 Dec 14 2023 05:45:04
%S 2,20,201,2012,20120,201201,2012012,20120120,201201201,2012012012,
%T 20120120120,201201201201,2012012012012,20120120120120,
%U 201201201201201,2012012012012012
%N Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,0,1.
%H Vincenzo Librandi, <a href="/A037519/b037519.txt">Table of n, a(n) for n = 1..100</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (10,0,1,-10).
%F G.f.: (x*(2+x^2)) / ((x-1)*(10*x-1)*(1+x+x^2)). - _R. J. Mathar_, Nov 21 2011
%t LinearRecurrence[{10,0,1,-10},{2,20,201,2012},40] (* _Vincenzo Librandi_, Nov 23 2011 *)
%t Table[FromDigits[PadRight[{},n,{2,0,1}]],{n,20}] (* _Harvey P. Dale_, Sep 18 2018 *)
%o (Magma) I:=[2, 20, 201, 2012]; [n le 4 select I[n] else 10*Self(n-1)+Self(n-3)-10*Self(n-4): n in [1..20]]; // _Vincenzo Librandi_, Nov 23 2011
%K nonn,base,easy
%O 1,1
%A _Clark Kimberling_