About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
August 2023 - Solution
August 2023 Solution:
The numerical solutions are 66 for googol and 653124034718489245484923772216924660058607596119243405888292084074025349410485980501955062384795 7752
for googolplex.
Since this is a very well-known problem, it can be solved by a quick journey to Wikipedia:
Of course, it can be argued that part of the fun is finding a formula independently without resorting to known results.
For googol, a formula is enough; for googolplex some manipluation of the formula is required, which results in a complex floating-point computation. A "*" was given for any good approximation resulting from this computation; a "**" was given to those who obtained an exact solution. The most common way to do this is by using an arbitrary precision floating point library such as `mpmath`:
One possible way of solving the problem with general prior knowledge in number theory but not specific for square- triangular numbers is by using the method for solving **Pell's equation** after a suitable reduction of the problem to it (the exact derivation is given in Wikipedia).
Another simple solution requiring only elementary tools in combinatorics is looking in the first few elements on the sequence:
And the first and second difference seqeunces:
It can be seen that the second difference sequence is the original sequence multiplied by 4; with little algebra this gives the recurrence relation
which can be solved to obtain
For googolplex it gives us
We end up with a problem in high-precision floating point arithmetic. A common solution many solvers used was to turn to a suitable library, e.g. Python's mpmath.