Here is the solution to the numbered houses divertimento.
The fun
The conversation between two mathematicians exchanging home addresses goes as follows:
–What is the number of your house?
–In my street the houses are numbered consecutively, from number one onwards. It turns out that the numbers of the houses on one side of mine add up to the same number as the numbers of the houses on the other side. What a coincidence!
–I can’t determine the number with that information -the other quickly replies-. Tell me at least how many houses there are, right?
–I can’t remember how many there are. I counted them a long time ago. I don’t know… between two and three hundred.
Is it possible to determine the number of the house?
Solution
Suppose there are \(N\) houses in total and the house number is \(n\). The numbers less than \(n\) add up to
$$1+\ldots+(n-1)=\frac{(n-1)n}{2},$$
while those greater than \(n\) add up to
$$(n+1) + \ldots + N = (1+\ldots + N) – (1+\ldots + n) = \frac{N(N+1)}{2}-\frac{n(n+1)}{2}.$$
Therefore,
$$\frac{(n-1)n}{2} = \frac{N(N+1)}{2}-\frac{n(n+1)}{2},$$
from which we deduce the equality
$$n^2 = \frac{N(N+1)}{2}.$$
From here several paths open up to find \(n\) and \(N\), which are respectively \(204\) and \(288\). Of course, one way is to use brute force (human or computational), as some readers have done. Although this was not our idea, we did not explicitly rule it out in the statement of the divertimento and they are therefore totally valid solutions. However, we will now describe two other more conceptual methods.
Since \(N\) and \(N+1\) are coprime, it follows that either \(N/2\) and \(N+1\) are squares, or else \(N\) and \((N+1)/2\) are squares.
- If \(N/2\) and \(N+1\) are squares, as \(200 \leq N \leq 300\), we have that \(N+1\) must be \(15^2=225\), \(16^2=256\) or \(17^2=289\), and only in the last case, \(N+1=289\), we obtain that \(N/2=144\) is a square.
- Likewise, if \(N\) and \((N+1)/2\) are squares, we have that \(N\) must be \(15^2=225\), \(16^2=256\) or \(17^2=289\). In none of these cases \((N+1)/2\) is a square, so we are left with what we obtained in the previous point.
Another approach is to solve the second-degree equation
$$n^2 = \frac{N(N+1)}{2}$$
in \(N\) as a function of \(n\), arriving at the following
$$N=\frac{-1 \pm \sqrt{1+8n^2}}{2}.$$
For this to make sense we must impose that the discriminant is an (odd) square, that is, \(1+8n^2=y^2\), which is a Pell equation.
To solve such an equation we can focus on a simpler one of the form \(y^2-2m^2=1\), taking \(m=2n\). Therefore, solutions whose second component is even will give us a solution to our problem, provided we also impose that \(400\leq m=2n\leq 600\). All the positive solutions \((y_k,m_k)\in\mathbb{Z}_{>0}^2\) are generated from the first non-trivial (so-called fundamental) one, \((y_1,m_1)=(3,2)\), taking
$$y_k+m_k\sqrt{2}=(3+2\sqrt{2})^k.$$
(Note that \(2\sqrt{2}=\sqrt{8}\); to solve the original equation it suffices to take \((y_1,m_1)=(3,1)\).) Of all these pairs, only the fourth has \(m_k\) between \(400\) and \(600\). Specifically, \((y_4,m_4)=(577,408)\). Therefore, \(n=204\) and \(N=288\).
A final possibility, say a somewhat more refined brute-force search, uses an important internet resource, the Online Encyclopedia of Integer Sequences (OEIS). Since \(n^2=N (N+1)/2\), it follows that the triangular number \(N(N+1)/2\) is a square. The triangular numbers that are squares are \(0\), \(1\), \(36\), \(1225\), \(41616\), \(1413721\), \(48024900\), \(1631432881\), \(55420693056\),… (sequence A001110 in the OEIS).Only with \(n^2=41616=204^2\) we obtain a value of \(N\) between \(200\) and \(300\), which is \(N=288\).
Leave a Reply