Re:Can LLMs write better code if you keep asking them to "wr...
by ryao on Friday January 03, 2025 @01:59PM
(#42588460)
Would someone write a mathematical proof showing this is always true?
[ Parent
| on HN ]
Re:Can LLMs write better code if you keep asking them to "wr...
by afiodorov on Friday January 03, 2025 @02:04PM
(#42588492)
a = [int(x) for x in str(n)][::-1]
assert n == sum(d*(10**i) for i, d in enumerate(a))
Now when you're operating mod 9, 10 == 1 % 9, thus 10**i == 1 % 9
Comes from the fact that (a*b) % 9 == (a % 9) * (b % 9)
Now using (a+b) % 9 == (a % 9) + (b % 9)
We get that that sum(a) and n are same mod 9.