Re:6174
by shermantanktop on Tuesday January 16, 2024 @04:31PM
(#39019432)
In some cases, the fact in base-10 has analogous facts in other bases. A trivial example that adding N-1 to any base-N number yields a value with the same digit sum. That makes it a bit more interesting. But I can't think of an example that doesn't pivot on the representation rather than something more fundamental.
[ Parent
| on HN ]
Re:6174
by shermantanktop on Tuesday January 16, 2024 @05:15PM
(#39019906)
Right, the digit sum of 10 is 1...perhaps I should have said "final digit sum." Same for 10000, or 1 with any number of zeroes after it.
The point of this trickery is that N-1 added to any number is really adding N (which adds 1 to the second position, by definition) and adding -1 (which subtracts 1 from the first position).
In base 10, this is the adding 9 trick. It can be extended by using any multiple of 9. That applies to the N-1 version, so that adding M*(N-1) to a base N number yields the same digit sum.
1+9 = 10 = 1
1 + 27 = 28 = 10 = 1
In hex:
1 + F = 10 = 1
1 + 2D = 2E = 10 = 1
Re:6174
by ChainOfFools on Tuesday January 16, 2024 @05:05PM
(#39019805)
i'm not sure what you are demonstrating?
1 sums digitwise to 1
1 + (10-1) = 10 which also sums to 1 in the same way