A377207 Number of n-digit numbers where every digit is either a 9 or adjacent to a 9.
1, 18, 99, 342, 2691, 13788, 65709, 407772, 2115981, 11108358, 63181719, 334551402, 1802963871, 9931645728, 53256984129, 288681869232, 1572458030361, 8484410567898, 46019764248939, 249748559819262, 1351163694059451, 7326501636596868, 39716608228492149, 215099382176679492
Offset: 1
Examples
The a(1) = 1 number is 9. The a(2) = 18 numbers are 19, 29, 39, 49, 59, 69, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
Links
- Index entries for linear recurrences with constant coefficients, signature (1,9,81).
Programs
-
PARI
Vec((1 + 8*x)*(1 + 9*x)/(1 - x - 9*x^2 - 81*x^3) + O(x^25)) \\ Andrew Howroyd, Oct 20 2024
Formula
G.f.: x*(1 + 8*x)*(1 + 9*x)/(1 - x - 9*x^2 - 81*x^3). - Andrew Howroyd, Oct 20 2024
Extensions
a(9) onwards from Andrew Howroyd, Oct 20 2024
Comments