congruum problem

The congruum problem is to find a square number x2 such that, when a given number h is added or subtracted, new square numbers are obtained, so that x2 + h = a2 and x2 - h = b2. This problem was posed by the mathematicians Théodore and Jean de Palerma in a mathematical tournament organized by Frederick II in Pisa in 1225. The solution is x = m2 + n2 and h = 4mn(m2 - n2), where m and n are integers.