The sum of the digits of a positive integer N is divisible by 14.
The sum of the digits of the next integer N+1 is also divisible by 14.
Find the smallest value of N.
If the last digit of N is < 9, then sod(N) - sod(N+1) = 1; so both cannot be divisible by 14.
Thus the last digit of N must be 9.
Construct N as a concatenation of "prefix" and "nines", where:
"nines" is a string of k 9s.
"prefix" is an integer that does not end in a 9.
Then sod(N) - sod(N+1) equals 9k-1.
So 9k-1 is a multiple of 14.
The first value for k which works is 11.
With k = 11, 9k-1 = 98 = 14*7 ie a multiple of 14.
So "nines" is a string of 11 9s.
What about the prefix? The sod of a string of 11 9s is 99 which is 1 mod 14. So the prefix must have an sod of 13. I'd try 49 since 4+9 is 13, but that makes the string of 9s longer, and that's another show.
The next smallest prefix with sod=13 is 58:
5899999999999 is N
5900000000000 is N+1
|
Posted by Larry
on 2024-08-31 09:58:03 |