# Is every integer a difference of two powers?

True or false? (I don't know.) Every positive integer is the difference of two powers. Examples: $1 = 3^2 - 2^3$
$2 = 3^3 - 5^2$
$3 = 2^7-5^3$
$4 = 2^3-2^2 = 5^3-11^2$
$5 = 2^5 - 3^3$
$6 = ?$
$7 = 2^5-5^2$
$8 =?$
$9 = 5^2-2^4$

• I don't think this question is as bad as it seems. It is clear that every integer not congruent to $2$ mod $4$ is a difference of two powers (namely two squares). However, for integers congruent to $2$ mod $4$ the answer is not clear to me. – GH from MO Apr 11 '18 at 19:11
• According to the Wikipedia page on Catalan's conjecture (en.wikipedia.org/wiki/Catalan%27s_conjecture), $6$ is not the difference of two powers. I would be delighted to see a proof of this result. – GH from MO Apr 11 '18 at 19:18
• @abx: The equation is not $n=a^2-b^2$ but $n=a^p-b^q$. It is definitely of research level, see the linked Wikipedia page. – GH from MO Apr 11 '18 at 19:43
• @GerryMyerson: It is a notorious open problem to say anything about the solutions of a single equation $a^p-b^q=n$ (where $a,b,p,q$ are all variables). On the other hand, it might be more accessible to show that the equation has no solution for some $n$ (without specifying this $n$), and that would answer the OP's question. – GH from MO Apr 11 '18 at 21:36
• Well, anyway, I can fill in one of the blanks: $8=2^3-0^3$. If use of zero is objectionable, then $8=2^4-2^3$. oeis.org/A074981 tabulates a conjectured list of positive integers not a difference of two powers; it begins 6, 14, 34, 42, 50, 58, 62, 66, 70, 78, 82, 86, 90. – Gerry Myerson Apr 11 '18 at 22:49