A181718 a(n) = (1/9)*(10^(2*n) + 10^n - 2).
0, 12, 1122, 111222, 11112222, 1111122222, 111111222222, 11111112222222, 1111111122222222, 111111111222222222, 11111111112222222222, 1111111111122222222222, 111111111111222222222222, 11111111111112222222222222, 1111111111111122222222222222
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Index entries for linear recurrences with constant coefficients, signature (111,-1110,1000).
Programs
-
Magma
[(1/9)*(10^(2*n) + 10^n - 2): n in [0..20]]; // Vincenzo Librandi, Aug 04 2011
-
Mathematica
Table[FromDigits[Join[PadRight[{},n,1],PadRight[{},n,2]]],{n,0,20}] (* or *) LinearRecurrence[{111,-1110,1000},{0,12,1122},20] (* Harvey P. Dale, Jul 31 2013 *)
-
PARI
vector(30, n, n--; (10^(2*n) + 10^n - 2)/9) \\ G. C. Greubel, Nov 02 2018
-
Python
for n in range(30): print((10**(2*n)+10**n-2)//9, end=', ') # Stefano Spezia, Nov 02 2018
-
SageMath
[(100^n +10^n -2)//9 for n in range(31)] # G. C. Greubel, Mar 25 2024
Formula
G.f.: 6*x*(2-35*x) / ( (1-x)*(1-10*x)*(1-100*x) ). - R. J. Mathar, Feb 28 2011
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3), a(0)=0, a(1)=12, a(2)=1122. - Harvey P. Dale, Jul 31 2013
a(n) = (A074992(n) - 1)/3. - Michel Marcus, Sep 14 2013
E.g.f.: (1/9)*(-2*exp(x) + exp(10*x) + exp(100*x)). - G. C. Greubel, Mar 25 2024
Comments