%I #25 Dec 14 2023 05:34:21
%S 2,22,221,2212,22122,221221,2212212,22122122,221221221,2212212212,
%T 22122122122,221221221221,2212212212212,22122122122122,
%U 221221221221221,2212212212212212
%N Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,2,1.
%H Edward Jiang, <a href="/A037567/b037567.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (10,0,1,-10)
%F G.f. x*(2+2*x+x^2) / ( (x-1)*(10*x-1)*(1+x+x^2) ). - _R. J. Mathar_, Nov 21 2011
%F (Start)
%F a(n) = floor(221/999 * 10^n).
%F a(n) = 10*a(n-1) + 1 + (n^2 mod 3).
%F (End) - _Robert Israel_, Sep 12 2014
%p seq(floor(221/999*10^n),n=1..30); # _Robert Israel_, Sep 12 2014
%o (PARI) a(n)=my(S=Str);for(i=0,n-1,S=concat(S,[2,2,1][i%3+1]));return(eval(S)) \\ _Edward Jiang_, Sep 11 2014
%K nonn,base
%O 1,1
%A _Clark Kimberling_