OFFSET
0,3
COMMENTS
a(n) is also the number of n-digit numbers whose smallest decimal digit is 1. - Stefano Spezia, Nov 15 2023
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
John Elias, Illustration of initial terms: Sierpinski Carpet
Wikipedia, Sierpinski carpet
Index entries for linear recurrences with constant coefficients, signature (17,-72).
FORMULA
G.f.: x/((1-8*x)*(1-9*x)).
E.g.f.: e^(9*x) - e^(8*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = 9*a(n-1) + 8^(n-1), a(0)=0. - Vincenzo Librandi, Feb 09 2011
a(n) = 17*a(n-1) - 72*a(n-2), a(0)=0, a(1)=1. - Vincenzo Librandi, Feb 09 2011
MATHEMATICA
LinearRecurrence[{17, -72}, {0, 1}, 31] (* Vladimir Joseph Stephan Orlovsky, Feb 09 2011 *)
PROG
(Magma) [9^n -8^n: n in [0..40]]; // G. C. Greubel, Nov 29 2024
(Python)
def A016185(n): return pow(9, n) - pow(8, n)
print([A016185(n) for n in range(41)]) # G. C. Greubel, Nov 29 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved