login
A037559
Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,1,1.
3
2, 21, 211, 2112, 21121, 211211, 2112112, 21121121, 211211211, 2112112112, 21121121121, 211211211211, 2112112112112, 21121121121121, 211211211211211, 2112112112112112
OFFSET
1,1
FORMULA
G.f.: x*(2+x+x^2) / ((1-x)*(1-10*x)*(1+x+x^2)). - R. J. Mathar, Nov 21 2011
a(n) = (633*10^n - 444 - 27*( 7*A049347(n) + 3*A049347(n-1) ))/2997. - G. C. Greubel, Oct 18 2022
MATHEMATICA
Table[FromDigits[PadRight[{}, n, {2, 1, 1}]], {n, 20}] (* Harvey P. Dale, Jul 15 2019 *)
PROG
(PARI) Vec(x*(2+x+x^2) / ((x-1)*(10*x-1)*(1+x+x^2)) + O(x^25)) \\ Jinyuan Wang, Apr 14 2020
(Magma) I:=[2, 21, 211, 2112]; [n le 4 select I[n] else 10*Self(n-1) +Self(n-3) -10*Self(n-4): n in [1..40]]; // G. C. Greubel, Oct 18 2022
(SageMath)
def A037559(n): return (633*10^n -444 -27*(7*chebyshev_U(n, -1/2) + 3*chebyshev_U(n-1, -1/2)))/2997
[A037559(n) for n in range(1, 40)] # G. C. Greubel, Oct 18 2022
CROSSREFS
Cf. A049347.
Sequence in context: A037736 A328073 A329318 * A042349 A037495 A024763
KEYWORD
nonn,base,easy
STATUS
approved