A335961 Alternating factorions: Numbers m such that m = S_af(m) = af(d_1)+af(d_2)+...+af(d_k) where d_1 d_2 ... d_n is the decimal expansion of m and af(m) = m!-(m-1)!+(m-2)!+...1! (alternating factorial) with af(0) = 0 (base 10).
0, 1, 620, 621, 643
Offset: 1
Examples
For m = 620, S_af(620) = af(6)+af(2)+af(0) = 619+1+0 = 620.
Programs
-
Mathematica
af[0] = 0; af[n_] := af[n] = n! - af[n - 1]; Select[Range[1000], Total[af /@ IntegerDigits[#]] == # &] (* Amiram Eldar, Jul 02 2020 *)
Comments