OFFSET
0,2
COMMENTS
In decimal, n times 1 followed by n times 2.
a(n) = 3 + 3*3, 33 + 33*33, 333 + 333*333, written with 3,6,9,12,... = A008585(n+1) 3's.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (111,-1110,1000).
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
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 *)
PROG
(Magma) [(1/9)*(10^(2*n) + 10^n - 2): n in [0..20]]; // Vincenzo Librandi, Aug 04 2011
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Nov 17 2010
STATUS
approved