0

Problem: For what pair of positive integers $(a,b)$ is $3^a + 7^b$ a perfect square.

First obviously $(1,0)$ works since $4$ is a perfect square, $(0,0)$ does not work, and $(0,1)$ does not work, so we can exclude cases where $a$ or $b$ are zero for the remainder of this post.

I have a few observations made but not much room for a full solution.

First, since powers of an odd number are odd, and the sum of two odd numbers is even, so the base of the square must be an even number.

Secondly, the last digit of the powers of $3$ are $\{1,3,7,9 \}$ , whereas the last digits of the powers of $7$ are $\{7,9,3,1 \}$.

From here I am not sure how to proceed and any hints much appreciated. I'm not sure if there a finite amount of pairs or not either.

  • 1
    The only pairs , I found so far , are $(1/0)$ and $(2/1)$ – Peter Oct 09 '17 at 21:44
  • 3
    Every square is either $0$ or $1$ modulo $4$. We have $$3^a+7^b\equiv(-1)^a+(-1)^b\mod4\ ,$$ therefore we must necessarily have $a$ even and $b$ odd, or the converse. – Daniel Robert-Nicoud Oct 09 '17 at 21:46
  • Since 3 is not a quadratic residue mod 7, either $a$ is even or $b=0$. If $b=0$ and $3^a + 1 = n^2$ then $(n-1)(n+1) = 3^a$ which implies $a=1, n=2$. If $a = 2a'$, and $3^a + 7^b = n^2$, then $(n - 3^{a'}) (n + 3^{a'}) = 7^b$. Therefore, both $n - 3^{a'}$ and $n + 3^{a'}$ are powers of 7. If $n - 3^{a'} = 7^{b_1}$ and $n + 3^{a'} = 7^{b_2}$, then $2 \cdot 3^{a'} = 7^{b_2} - 7^{b_1}$. Since 7 does not divide the left hand side, $b_1 = 0$. From here, I'm not sure how to continue - but maybe looking at $2 \cdot 3^{a'} \pmod{7^2}$ might give some more information. – Daniel Schepler Oct 09 '17 at 21:57
  • 1
    Since for $0\le a,b\le 1000$, the only pairs are $(1/0)$ and $(2/1)$, another pair would be a mircale considering how large one of the powers must be. However, proving this could be extremely difficult, but it could also be relatively easy if someone finds a clever trick. – Peter Oct 09 '17 at 22:01
  • @Peter which programming language do you use to compute such things? I see that in most of number theory questions you give immediate results to a very good range. – Vidyanshu Mishra Oct 09 '17 at 22:03
  • 1
    @VidyanshuMishra PARI/GP is very powerful for such questions! There are surely faster programs, however. – Peter Oct 09 '17 at 22:04
  • 1
    Ah.. Thanks @Peter, I shall have a look at it. – Vidyanshu Mishra Oct 09 '17 at 22:04
  • 1
    Hmm, from $2 \cdot 3^{a'} \equiv -1 \pmod{7^2}$ all I get is that if $b \ge 2$, then $a' \equiv 37 \pmod{42}$ (and no, $2 \cdot 3^{37} + 1$ is not a power of 7). – Daniel Schepler Oct 09 '17 at 22:08
  • It seems this problem is out of the scope of what I knew a priori and will require me to study more. Sorry for the lousy attempt, I thought it might be simpler. – IntegrateThis Oct 09 '17 at 22:17
  • @DanielSchepler Can you explain the first sentence of your comment I do not follow unfortunately. – IntegrateThis Oct 10 '17 at 02:09
  • That first sentence is just a fancy way of saying: if $b \ne 0$, then $3^a \equiv n^2 \pmod{7}$, but comparing the powers of 3 to the squares $\pmod{7}$ you'll see the only place where they match is when $a$ is even. – Daniel Schepler Oct 10 '17 at 03:30
  • Whoever has 2000 or more (not less) reputation points just on the current site must check my question which is titled "When is 991n^2+1 a perfect square" and then delete my recent comments, one of which I posted on the current site 60+ mins ago, the other of which I posted on the current site 53 mins ago along with my other few comments, all of which I posted on the current site 8 years ago –  Feb 10 '24 at 07:34
  • https://math.stackexchange.com/questions/1673657/when-is-991n2-1-a-perfect-square/1674290#1674290 –  Feb 22 '24 at 13:44
  • I don't feel as if there is any such number –  Feb 22 '24 at 14:02

4 Answers4

4

Here is a solution using less machinery than in Will Jagy's answer.

As Daniel Robert-Nicoud noted in comments, the fact that $3^a+7^b\equiv(-1)^a+(-1)^b$ mod $4$ implies $a$ and $b$ must have opposite parity in order for the (even) sum $3^a+7^b$ to be a perfect square. So we seek to show that $(a,b)=(1,0)$ is the only solution in the (odd,even) case and $(a,b)=(2,1)$ is the only solution in the (even,odd) case.

If $a$ is odd and $b=2m$ is even, then we can rewrite $3^a+7^b=n^2$ as $3^a=(n+7^m)(n-7^m)$. This implies $n+7^m$ and $n-7^m$ are each powers of $3$, say $3^c$ and $3^d$ with $c+d=a$. But then $2\cdot7^m=3^c-3^d$, so we must have $d=0$ and $c=a$, since $3\not\mid2\cdot7^m$. One solution to $2\cdot7^m=3^a-1$ is $(a,m)=(1,0)$. It remains to show there are no solutions with $m\gt0$. For this it suffices to note that $3^a\equiv1$ mod $7$ if and only if $6\mid a$, which contradicts the assumption that $a$ is odd.

In the other parity case, if $a=2m$ is even and $b$ is odd, then, along similar lines, we must have $2\cdot3^m=7^b-1$, which has $(m,b)=(1,1)$ as one solution. After checking that there is no solution with $m=0$, it remains to show there are no solutions with $m\gt1$. If there were, then we would have $7^b\equiv1$ mod $9$, which would imply $b\equiv3$ mod $6$ (since $6$ is the order of the multiplicative group of units mod $9$ and $7^3\equiv(-2)^3=-8\equiv1$ mod $9$). Writing $b=3r$ (with $r$ odd, but that doesn't matter), we note that $(7^3-1)\mid(7^{3r}-1)$, so that $7^3-1=2\cdot3^2\cdot19$ divides $2\cdot3^m$, an obvious contradiction.

Barry Cipra
  • 79,832
  • Good. In the various problems I had done previously, often a full divisor, such as $7^{12} - 1,$ had several factors that were not used, and a smaller divisor such as your $7^3 -1$ gave enough, in this case the prime $19.$ I used the prime $43$ out of $7^{12} - 1.$ Lack of practice. Plus, of course, I did not use the full strength of Daniel's comment. – Will Jagy Oct 10 '17 at 17:11
  • Wow. That is a fantastic answer much appreciated. – IntegrateThis Oct 10 '17 at 19:58
  • why does d = 0 and c = a ? – IntegrateThis Oct 11 '17 at 04:22
  • 1
    @IntegrateThis, if $c$ and $d$ are both greater than $0$, then $3\mid(3^c-3^d)$. But $3\not\mid2\cdot7^m$. – Barry Cipra Oct 11 '17 at 12:26
2

Just to register, from the comment by Daniel, there are just two possibilities, if the result is $x^2,$ either $$ 1 + 2 \cdot 3^c = 7^d, $$ or $$ 1 + 2 \cdot 7^e = 3^f. $$

I would guess that an elementary method shown in an answer by Gyumin Roh to http://math.stackexchange.com/questions/1551324/exponential-diophantine-equation-7y-2-3x can be modified for this task. My way of working with this takes a while...

http://math.stackexchange.com/questions/1941354/elementary-solution-of-exponential-diophantine-equation-2x-3y-7

http://math.stackexchange.com/questions/1941354/elementary-solution-of-exponential-diophantine-equation-2x-3y-7/1942409#1942409

http://math.stackexchange.com/questions/1946621/finding-solutions-to-the-diophantine-equation-7a-3b100/1946810#1946810

http://math.stackexchange.com/questions/2100780/is-2m-1-ever-a-power-of-3-for-m-3/2100847#2100847

Will Jagy
  • 139,541
1

The technique I mentioned is working. One of the cases is $$ 1 + 2 \cdot 3^c = 7^d, $$ where we think that $c=d=1$ gives the largest such answer. Subtract $7$ from both sides, $$ 2 \cdot 3^c - 6 = 7^d - 7. $$ Let $y+1 = c,$ $x+1 = d,$ for $$ 6 \cdot 3^y - 6 = 7 \left( 7^x -1 \right), $$ $$ 6 \left( 3^y -1 \right) = 7 \left( 7^x -1 \right). $$ We are assuming $x,y \geq 1,$ with both sides being nonzero.

$$ 3^y \equiv 1 \pmod 7, $$ $$ y \equiv 0 \pmod 6. $$ Next, $3^y - 1$ is divisible by $3^6 - 1 = 728 = 8 \cdot 7 \cdot 13.$

$$ 7^x \equiv 1 \pmod {13}, $$ $$ x \equiv 0 \pmod {12}. $$ Next, $7^x - 1$ is divisible by $7^{12} - 1 = 13841287200 = 32 \cdot 9 \cdot 25 \cdot 13 \cdot 19 \cdot 43 \cdot 181.$

$$ 3^y \equiv 1 \pmod {43}, $$ $$ y \equiv 0 \pmod {42}. $$ Next, $3^y - 1$ is divisible by $3^{42} - 1 = 109418989131512359208 = 8 \cdot 7^2 \cdot 13 \cdot 43 \cdot 547 \cdot 1093 \cdot 2269 \cdot 368089$

All we care about is that $3^y - 1$ is divisible by $7^2 = 49,$ as this contradicts the assumption of $x \geq 1$ in $$ 6 \left( 3^y -1 \right) = 7 \left( 7^x -1 \right). $$ $$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

Will Jagy
  • 139,541
1

The other case is $1 + 2 \cdot 7^x = 3^y,$ or $$ 3^y - 1 = 2 \cdot 7^x. $$ Assume $x \geq 1.$ Then both sides are divisible by $7,$ giving $$ 3^y \equiv 1 \pmod 7, $$ $$ y \equiv 0 \pmod 6. $$ Then $3^y - 1$ is divisible by $$ 3^6 - 1 = 728 = 8 \cdot 7 \cdot 13. $$ However, then $2 \cdot 7^x$ is divisible by $13,$ which is a contradiction. $$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

Will Jagy
  • 139,541