A229127 Number of n-digit numbers containing the digit '0'.
1, 9, 171, 2439, 30951, 368559, 4217031, 46953279, 512579511, 5513215599, 58618940391, 617570463519, 6458134171671, 67123207545039, 694108867905351, 7146979811148159, 73322818300333431, 749905364703000879, 7649148282327007911, 77842334540943071199
Offset: 1
Examples
a(2) = 9, since there are 9 2-digit numbers that contain a '0'.
Links
- Index entries for linear recurrences with constant coefficients, signature (19,-90).
Programs
-
Mathematica
LinearRecurrence[{19,-90},{1,9,171},20] (* Stefano Spezia, Nov 15 2023 *)
Formula
For n > 1, a(n) = 9*10^(n-1) - 9^n.
For n > 2, a(n) = 9*(a(n-1) + 10^(n-2)).
G.f.: x*(1-10*x+90*x^2)/((1-9*x)*(1-10*x)). - R. J. Mathar, Sep 14 2013
E.g.f.: (9*exp(10*x) - 10*exp(9*x) + 10*x + 1)/10. - Stefano Spezia, Nov 15 2023
Extensions
Example added and g.f. corrected by Hieronymus Fischer, Dec 27 2013
Comments