Monthly Archives: January 2014

Powers of 2

Yesterday, James Tanton posted a fun little problem on Twitter:

2powersSo, 2 is one more than 1=2^0, and 8 is one less than 9=2^3$, and Dr. Tanton wants to know if there are any other powers of two that are within one unit of a perfect square.

While this problem may not have any “real-life relevance”, it demonstrates what I describe as the power and creativity of mathematics.  Among the infinite number of powers of two, how can someone know for certain if any others are or are not within one unit of a perfect square?  No one will ever be able to see every number in the list of powers of two, but variables and mathematics give you the tools to deal with all possibilities at once.

For this problem, let D and N be positive integers.  Translated into mathematical language, Dr. Tanton’s problem is equivalent to asking if there are values of D and N for which 2^D=N^2 \pm 1.  With a single equation in two unknowns, this is where observation and creativity come into play.  I suspect there may be more than one way to approach this, but my solution follows.  Don’t read any further if you want to solve this for yourself.


Because D and N are positive integers, the left side of 2^D=N^2 \pm 1,  is always even.   That means N^2, and therefore N must be odd.

Because N is odd, I know N=2k+1 for some whole number k.  Rewriting our equation gives 2^D=(2k+1)^2 \pm 1, and the right side equals either 4k^2+4k or 4k^2+4k+2.

Factoring the first expression gives 2^D=4k^2+4K=4k(k+1).   Notice that this is the product of two consecutive integers, k and k+1, and therefore one of these factors (even though I don’t know which one) must be an odd number.  The only odd number that is a factor of a power of two is 1, so either k=1 or k+1=1 \rightarrow k=0.  Now, k=1 \longrightarrow N=3 \longrightarrow D=3 and k=0 \longrightarrow N=1 \longrightarrow D=0, the two solutions Dr. Tanton gave.  No other possibilities are possible from this expression, no matter how far down the list of powers of two you want to go.

But what about the other expression?  Factoring again gives 2^D=4k^2+4k+2=2 \cdot \left( 2k^2+2k+1 \right) .  The expression in parentheses must be odd because its first two terms are both multiplied by 2 (making them even) and then one is added (making the overall sum odd).  Again, 1 is the only odd factor of a power of two, and this happens in this case only when k=0 \longrightarrow N=1 \longrightarrow D=0, repeating a solution from above.

Because no other algebraic solutions are possible, the two solutions Dr. Tanton gave in the problem statement are the only two times in the entire universe of perfect squares and powers of two where elements of those two lists are within a single unit of each other.

Math is sweet.