A370369 a(n) = n! + Sum_{k=1..n-1} (n-k)*k! = n! + A014145(n-1); for n >= 2, number of m such that any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order.
1, 3, 10, 37, 166, 919, 6112, 47305, 416098, 4091131, 44417044, 527456557, 6798432070, 94499679583, 1408924024696, 22425642181009, 379514672913322, 6804212771165635, 128827325000617948, 2568509718703606261, 53787877376348226574, 1180349932648067726887, 27086018941198865627200
Offset: 1
Examples
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.
Programs
-
PARI
a(n) = n! + sum(k=1, n-1, (n-k)*k!)
Comments