OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (20,-100).
FORMULA
a(n) = 9*(9*n+1)*10^(n-2).
a(n) = 20*a(n-1) - 100*a(n-2); a(1)=9, a(2)=171.
a(n) = 9*A081045(n-1).
From Elmo R. Oliveira, Nov 19 2025: (Start)
G.f.: 9*x*(1-x)/(10*x-1)^2.
E.g.f.: 9*(exp(10*x)*(90*x+1) - 1)/100. (End)
EXAMPLE
a(1) = 9 because there are 9 one-digit numbers that are > 0.
a(2) = 171 because there are 90 two-digit numbers, so 90*2 = 180 digits are needed to write these integers, nine of these integers end with 0, and 180-9 = 171.
MAPLE
seq((9*(9*n+1))*10^(n-2), n = 1 .. 20);
MATHEMATICA
a[n_] := 9*(9*n + 1)*10^(n - 2); Array[a, 20] (* Amiram Eldar, Nov 23 2022 *)
PROG
(PARI) a(n)=(81*n+9)*10^(n-2) \\ Charles R Greathouse IV, Nov 29 2022
(Python)
def A358620(n): return 9 if n == 1 else 9*(9*n+1)*10**(n-2) # Chai Wah Wu, Nov 29 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Bernard Schott, Nov 23 2022
STATUS
approved
