M = 1000*N - 10000*floor(N/10) + floor (N/10)
So N - M = N - [1000*N - 10000*floor(N/10) + floor(N/10)] = 9999*floor(N/10) - 999N = 3105
Dividing both sides by 9 gives 1111*floor(N/10) - 111N = 345
If N = 0 mod 10, then floor(N/10) = N/10, so we have 1111*N/10 - 111N = .1N = 345, so N = 3450 is a solution.
If we increment N by 1, then the floor(N/10) part remains unchanged, but the -111N part contributes an extra -111 to the LHS of the equation, so the RHS decreases by 111.
Once we reach the next value of N that is 0 mod 10, we add another 1111 to the LHS. The net result is 10 * (-111) + 1111 = 1. So incrementing N by 10 increments the RHS of the equation by 1.
So to make the RHS = 345, we can add 1111 to N (the first 1110 will add 111 to the RHS, and then the last 1 will deduct 111 from the RHS).
So additional solutions are 4561, 5672, 6783, 7894, and 9005.
|
Posted by tomarken
on 2014-07-07 15:38:04 |