I encountered a programming problem that need a little math. Since I took number-theory long time ago, from the top of my head, I could not think of a way to approach this problem.
Give a base 'b' ( 2, 3, 4, 5, 6 ... -> 26 ). So if I'm at base 10, I will have 10 digits: 0, 1, 2, 3...9. The digit of a base 'b' is called interesting if it satisfy this condition:
3 is an interesting digit because 118*3 = 354 and 3+5+4 = 12. Which means both 354 and 12 divides 3. By look at the result sets, I can see the relation is:
if b mod d = 1 then d is an interesting digit.
For example: 10 mod 9 = 10 mod 3 = 1. So both 3, 9 are interesting digits in base 10.
How could I prove this? Any hint?
Thanks,
Chan