
FORMULA

For a number n with d1 digits there are d1Pd2 = d1!/(d1d2)! substrings generated by sampling and permutating d2 digits from the original number. When n=132 and d2=2, these substrings are 13, 31, 32, 23, 12, 21. When n=112 and d2=2, the substrings are 11, 11, 12, 21, 12, 21. Sum(x,d) is defined as the sum of ddigit substrings for a number x. The sequence above is those numbers such that sum(x,d) = x, where d = 2, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14.
