Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you look close enough, all those "special" numbers are divisible by 9.

I made a quick experiment with other bases.

3-digits numbers, base 8 has fixed point 374_8=252_10. 252 `mod` 7 = 0.

base-9, base-11 and base 13 seem do not have fixed points.

base-12, 3 digits has (at least one) fixed point 5b6_12 = 858_10. 858 `mod` 11 = 0.

I think, it exploits some properties of positional notation of numbers so that fixed points all divisible by (base-1).



Not just the special numbers.

Kaprekar's operation always results in a multiple of 9.

Given a > b > c > d. Kaprekar's operation gives:

    1000a + 100b + 10c + d - (1000d + 100c + 10b + a)
    =999(a - d) + 90(b - c)
    =9(111(a - d) + 10(b - c))
And so on for integers with other numbers of digits.


Any number subtracted from a re-arrangement of the digits results in a multiple of 9.


Why?


A number is the sum of its digits, raised to the appropriate powers

    Sum(i=0..n, a[i]*10^i)
123, for example is 3 + 2 * 10 + 1 * 100.

A power of 10 (10^n) can be re written as

    (1 + 9 * Sum(i=0..n-1, 10^i). 
For example: 1000 = 1 + 999 = 1 + 900 + 90 + 9

When you subtract two numbers with the same digits, you end up being able to factor a nine out of these sums fairly easily.

I wrote a proof of the number - reverse(number) a while back. It can be found on archive.org

http://web.archive.org/web/20050314023901/http://jimfl.tense...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: