2025 SSMO Relay Round 5 Problems/Problem 3

Problem

Let $T = TNYWR.$ How many positive integers $n$ satisfy \[\operatorname{lcm}(\operatorname{gcd}(n, n^2 + T^2), \operatorname{gcd}(T, n^2 + T^2)) = \operatorname{lcm}(n, T)?\]

Solution