• It is easy to find the solution in single digits. If the professor's house is the 4th odd-numbered one, his house number is 7, the sum of the house numbers is 1+3+5+7=16. If the last house on the street is the 5th, its number is 9 and the sum of the houses from that end to the professor's house is 9+7=16.
  • But of course, the problem requires a two-digit house number, so that solution is not the correct one.
  • Let's say that the professor's is the n-th house
  • The n-th odd number is (2n - 1). (The first house is 1, the second 3, the third 5...)
  • The sum of the first n odd numbers is n2. (The sum of the first 1 is 1, the sum of the first 2 is 1+3=4, the sum of the first 3 is 1+3+5=9...)
  • Let's say that the block has m houses (the last one is numbered 2m - 1)
  • The sum of the house numbers m through n (in numbers diminishing by 2) is the number in the professor's head, which is n2
  • The sum of the 1st n-1 houses (upto the professor's house but not including it) is (n-1)2
  • So, (n-1)2 + n2 = m2 where n and m are integers. To say it in English, we need to find two consecutive integers, the sum of whose squares is the square of another integer.
  • It turns out that the next {n, m} pair is {21, 29} since 202 + 212 = 292. In that case, the professor's house number is 41 and the last house number is 57.