OFFSET
1,2
COMMENTS
Given n, the largest such number is Sum_{i=0..n-1} i*n^i = A062813(n). If zero is excluded, the number of such k with d digits in base n, 1 <= d <= n, is (n+1-d)*d! - (d-1)!.
EXAMPLE
a(3) = 10 because such numbers are 0_3, 1_3, 2_3, 10_3, 12_3, 21_3, 102_3, 120_3, 201_3 and 210_3.
a(10) = 4091131 is the number of terms of A215014.
PROG
(PARI) a(n) = n! + sum(k=1, n-1, (n-k)*k!)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jianing Song, Feb 16 2024
STATUS
approved