Let P = all numbers that can be obtained by permuting the digits of n and possibly adding or omitting zeros; a(n) = |n-q| where q in P is the closest number to n different from n (a(n)=0 if no such q exists).

A052484

Let P = all numbers that can be obtained by permuting the digits of n and possibly adding or omitting zeros; a(n) = |n-q| where q in P is the closest number to n different from n (a(n)=0 if no such q exists).

Terms

    a(0) =0a(1) =9a(2) =18a(3) =27a(4) =36a(5) =45a(6) =54a(7) =63a(8) =72a(9) =81a(10) =9a(11) =90a(12) =9a(13) =18a(14) =27a(15) =36a(16) =45a(17) =54a(18) =63a(19) =72a(20) =18a(21) =9a(22) =180a(23) =9a(24) =18a(25) =27a(26) =36a(27) =45a(28) =54a(29) =63

External references