Recognition criterion for triangular numbers
ID: recognition-criterion-for-triangular-numbers
A nonnegative integer is a triangular number exactly when is a perfect square. Its square root is then an odd integer, and the row index isCompleting the square in proves necessity; reversing the calculation proves sufficiency. For example, , giving . In contrast, lies strictly between and , so twenty is not a triangular number. The criterion turns an apparently open-ended search through a sequence into one exact perfect square check.
New to topics? Read the docs here!