M is any positive real number less than 2022.
Determine the total number of values of M for which the graphs of
y=abs(abs(abs(x-M)-x)-x) and y=x
intersect only at points with integer coordinates when graphed on the X-Y plane.
(In reply to
Solution by Jer)
I agree with the answer of 505, but there are some errors in the solution.
abs(abs(abs(x-M)-x)-x) =x
if and only if
M=-2x or M=4x or M=0 or M=2x
So for any positive M, x = 0 is not a solution (unless M = 0)
For any positive M, the only solutions are x = M/4 and x=M/2.
In order for all solutions to be integers, M must be an integer multiple of 4.
There are 505 such positive M's which are <= 2022.
Bonus note:
For any negative M, the only solution is x = -M/2.
In order for all solutions to be integers, M must be an integer multiple of -2.
Edited on December 10, 2022, 10:50 am