AMC 10A/12A 2024 (Problem 15/9)Let MMM be the greatest integer such that both M+1213M+1213M+1213 and M+3773M+3773M+3773 are perfect squares. What is the units digit of MMM?(A) 1\text{(A)}\;1(A)1(B) 2\text{(B)}\;2(B)2(C) 3\text{(C)}\;3(C)3(D) 6\text{(D)}\;6(D)6(E) 8\text{(E)}\;8(E)8Related TopicsToolkit 10 — Difference of squaresToolkit 47 — Modular Arithmetic: Definition and PropertiesHints (5)Hint 1M+1213=x2M+3773=y2WLOG x,y≥0y2−x2=2560\begin{aligned}M+1213&=x^2\\M+3773&=y^2\\[6pt]\text{WLOG }x,y&\ge 0\\[6pt]y^2-x^2&=2560\end{aligned}M+1213M+3773WLOG x,yy2−x2=x2=y2≥0=2560Hint 2(y−x)(y+x)=2560(y-x)(y+x)=2560(y−x)(y+x)=2560Hint 3To maximize M, we should maximize y.(y−x)(y+x)=2560,y=(y−x)+(y+x)2y−xy+xy12560256122128012822=64146406442=322⋮⋮⋮\begin{aligned}&\text{To maximize }M,\text{ we should maximize }y.\\[8pt]&(y-x)(y+x)=2560,\qquad y=\frac{(y-x)+(y+x)}{2}\\[10pt]&\begin{matrix}y-x&y+x&y\\[4pt]1&2560&\frac{2561}{2}\\[4pt]2&1280&\frac{1282}{2}=641\\[4pt]4&640&\frac{644}{2}=322\\[2pt]\vdots&\vdots&\vdots\end{matrix}\end{aligned}To maximize M, we should maximize y.(y−x)(y+x)=2560,y=2(y−x)+(y+x)y−x124⋮y+x25601280640⋮y2256121282=6412644=322⋮Hint 4M+3773=y2⇒max{M}=max{y2}−3773M+3773=y^2\quad\Rightarrow\quad \max\{M\}=\max\{y^2\}-3773M+3773=y2⇒max{M}=max{y2}−3773Hint 5max{M}=6412−3773≡1−3≡−2≡8(mod10)\max\{M\}=641^2-3773\equiv 1-3\equiv -2\equiv 8\pmod{10}max{M}=6412−3773≡1−3≡−2≡8(mod10)Final Answer(E) 8