%I #13 Apr 21 2024 22:12:06
%S 1,2,7,35,215,1535,12455,113255,1141415,12632615,152341415,1988514215,
%T 27934434215,420236744615,6740662856615,114841743944615,
%U 2071122598472615,39418302548552615,789563088403016615,16603426141551176615,365724864314899016615,8421063413387754056615
%N a(n) = (n+2)*a(n-1) + (n+1)*(A003422(n) - 4)/6 for n > 0 with a(0) = 1.
%C Adjacent terms of s(n, m) from the formula section (for m > 1) have k identical digits at the end in any number system q > 1.
%F b(2n+1, m) = m*b(n, m) for n >= 0.
%F b(2n, m) = b(n, m) + b(n - 2^f(n), m) + b(2n - 2^f(n), m) for n > 0 with b(0, m) = 1 where f(n) = A007814(n).
%F s(n, m) = Sum_{k=0..2^n - 1} b(k, m) = (n+m)*s(n-1, m) + ((m+1)^2 - 4)*(n+m-1)*(g(n+m-2) - g(m+1))/((m+3)*(m+1)!) for n > 0 with s(0, m) = 1 where g(n) = A003422(n).
%F a(n) = s(n, 2) for n >= 0.
%o (PARI) lf(n) = sum(k=0, n-1, k!); \\ A003422
%o a(n) = if (n, (n+2)*a(n-1) + (n+1)*(lf(n) - 4)/6, 1); \\ _Michel Marcus_, Jan 11 2022
%Y Cf. A003422, A006157 (first differences), A007814.
%Y Similar recurrences: A006014, A124758, A217924, A243499, A284005, A290615, A329369, A341392, A347204, A347205.
%K nonn
%O 0,2
%A _Mikhail Kurkov_, Dec 24 2021 [verification needed]