Why is any number N of base B, whose digits sum to a multiple of a prime factor P of B-1, also divisible by P?
(Also, how do you ask that question more succinctly?)
For examples:
- B=7, P=2, N=22
- B=7, P=3, N=12
- B=10, P=3, N=18
By way of background, this came from thinking about how any number whose digits sum to a multiple of 3 is also divisible by 3. I can get as far as generalising it to the above question, and I can vaguely see "why" but haven't been able to prove it.
The vaguely why is that each number in B is constructed of multiples of digits in 0..B-1, whether you are summing digits or digits^(0..B-1). (maybe?)
Also thought it might be something to do with how carrying works when you're adding numbers.