There are exactly four positive integers n such that

\( \frac{(n + 1)^2}{n + 23}\ \)

is an integer. Compute the largest such n.

By simple iteration the 4 values of n are:

21, 98, 219, 461. Therefore the largest n = 461