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.
November 2020 - Solution
A simple solution can be based on the ability to use power manipulations to perform subtractions:
4, 2^2, 31 4, 2^2^31 4^2^2^31 4^2, 2^(2^31-1) 4^2, 2, 2^31-1
Even without the subtraction trick, there are many other methods of solution, e.g.,
2, 2^4, 536870911, 2^3 2, 2^2147483644, 2^3 2^2^2147483644, 2^3 2^2^2147483647 2, 2^2147483647 2, 2, 2147483647
If we begin with 64, an endless stream of "2" can be generated:
64 2, 8 256 16, 2 2^16 2, 2^8 16, 2, 2
Repeating this and using a subtraction trick, one can reach 4, 2^2, 31 and proceed as before. Also, for those who love brute-force solutions, one can simply generate "2" for 2147483647 times and apply as powers on 2^2.