OFFSET
1,1
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
Index entries for linear recurrences with constant coefficients, signature (11,-10).
FORMULA
a(n) = (10^n -1) - 10^(n-1), n > 1.
a(n+1) = 10*a(n) + 9. - Reinhard Zumkeller, May 28 2010
G.f.: 9*x - x^2*(-89+80*x) / ( (10*x-1)*(x-1) ). - R. J. Mathar, Oct 29 2011
EXAMPLE
a(1) = 9 - 0 = 9, a(4) = 9999 - 1000 = 8999.
MATHEMATICA
Join[{9}, Table[FromDigits[PadRight[{8}, n, 9]], {n, 2, 20}]] (* or *) LinearRecurrence[{11, -10}, {9, 89, 899}, 20] (* Harvey P. Dale, May 09 2021 *)
PROG
(Magma) [9], [9*10^n-1: n in [1..30]]; // Vincenzo Librandi, Oct 29 2011
(PARI) a(n)=if(n>1, (10^n-1)-10^(n-1), 9) \\ Charles R Greathouse IV, Oct 29 2011
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Aug 14 2005
STATUS
approved