Solution: A Special Squarish Age
A brute force way to find the answer is to start enumerating the squarish numbers:
0*1=0
1*2=2
2*3=6
3*4=12
4*5=20
5*6=30
6*7=42
7*8=56
8*9=72
9*10=90
10*11=110
11*12=132
…
Now, all we need to do is find two consecutive numbers in this list whose difference is also in the list. We get:
The difference between 0*1=0 and 1*2=2 is 2, which is also a squarish number (1*2=2).
The difference between 2*3=6 and 3*4=12 is 6, which is also a squarish number (2*3=6).
The difference between 5*6=30 and 6*7=42 is 12, which is also a squarish number (3*4=12).
The difference between 9*10=90 and 10*11=110 is 20, which is also a squarish number (4*5=20).
…
The most reasonable guess of these numbers (2, 12, 42, 110, …) as the age of someone working in Windows is 42, which is indeed how old my friend is. The next time his age would have this property would be in another 68 years (110-42=68).
You can also solve the problem with some simple algebra. Suppose my friend’s current age is the squarish number x*(x+1). Then, the previous time his age was a squarish number was (x-1)*x (which requires x >= 1). The difference is between these two ages is:
x*(x+1) - (x-1)*x = (x+1)*x - (x-1)*x = (x+1 - (x-1))*x = 2*x
We’re looking for an age for which this difference is squarish. So for x we can pick half of any positive squarish number (2/2=1, 6/2=3, 12/2=6, 20/2=10, 30/2=15, …). Plugging this into x*(x+1) we get the possible ages 2, 12, 42, 110, 240, …