This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A370369 #9 Feb 23 2024 20:14:14 %S A370369 1,3,10,37,166,919,6112,47305,416098,4091131,44417044,527456557, %T A370369 6798432070,94499679583,1408924024696,22425642181009,379514672913322, %U A370369 6804212771165635,128827325000617948,2568509718703606261,53787877376348226574,1180349932648067726887,27086018941198865627200 %N 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. %C A370369 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)!. %e A370369 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. %e A370369 a(10) = 4091131 is the number of terms of A215014. %o A370369 (PARI) a(n) = n! + sum(k=1, n-1, (n-k)*k!) %Y A370369 Cf. A215014, A014145, A062813. %K A370369 nonn,base,easy %O A370369 1,2 %A A370369 _Jianing Song_, Feb 16 2024