OFFSET
1,3
COMMENTS
Equivalently, a(n) is the number of n-digit numbers whose set of decimal digits is {0,1,...,k} for some k, 1 <= k <= 9.
a(n) is the number of n-digit terms of A305701.
For 1 <= n <= 10, a(n) = A343583(n-1). The sequences first differ at n = 11, since decimal notation has only the ten digits 0,1,...,9.
FORMULA
a(n) = Sum_{k=1..9} k*k!*StirlingS2(n,k+1).
EXAMPLE
a(3) = 7, since the 3-digit numbers satisfying the condition are 100, 101, 102, 110, 120, 201, and 210.
MATHEMATICA
a[n_] := Sum[k*k!*StirlingS2[n, k + 1], {k, 1, Min[9, n - 1]}];
Table[a[n], {n, 1, 22}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bartlomiej Pawlik, Jul 05 2026
STATUS
approved
