Hello.I was looking at the applet "A line in a square grid" at https://www.cut-the-knot.org/Curriculum/Geometry/LineThroughGrid.shtml
I entered M=27 and N=40. According to the final formula, the line should pass through M+N-1 = 66 squares (since the gcd = 1). However, I only counted 60 squares colored in grey by the applet. Furthermore, the line appeared to pass through grid nodes, which would indicate a common divisor > 1
Is there a problem with the applet's drawing resolution capacity? I see that "40" is the limit for M and N. Could there be a problem with the applet's algorithm when MAX values are employed?
Otherewise, this is an extraordinary web-page. Very fun!
Jody Nagel