0

I have been wondering for a while if there is a method to solving the following form of equation $a^n + b^n = c$ Where a,b,c are all integers. For example, $2^n + 5^n = 29$. One can quickly see that n is 2 but is there a general method?

  • Maybe not. For small values of $a,b,c$ human or computer calculation can do it . But for great values always there are ones for which the most extraordinary computer can not it. – Piquito Apr 21 '22 at 09:30
  • 1
    There may not be a solution. For example, take $2^n+3^n=12$, or $2^n+5^n=28$. By the way, we don't quickly see for $2^n+5^n=133$ that $n$ is $2$. It is $n=3$. – Dietrich Burde Apr 21 '22 at 09:51
  • Sure, those no integer solution for $2^n+5^n=28$, but there's a real solution, 1.976319485279632321968260635508570... – PM 2Ring Apr 21 '22 at 11:08
  • @PM2Ring I took it for granted that we were looking only for integer solutions. – Gribouillis Apr 21 '22 at 11:12
  • @Gribouillis Of course, especially when the variable's name is $n$. ;) But I figured a real solution (which I found using Newton's method) may be of interest to some readers. – PM 2Ring Apr 21 '22 at 15:21

2 Answers2

2

There is, in general, no closed form solution to the equation $a^x + b^x =c$.

We can (from the monotonicity of the function $x\mapsto a^x + b^x$) show that a solution exists for every $c>0$, but (unless ofcourse if $a=0$ or $b=0$), the solution can only be calculated numerically.

That said, if you know an integer solution exists, then you can find it by bisection. First, try to evaluate $a^n+b^n$ for $n=1,2,4,8,16,\dots$ until you reach some value of $n$ for which $a^n+b^n>c$. Then, use bisection to narrow down your choices for $n$. By that I mean:

  • Start with $n_1,n_2$ such that $a^{n_1}+b^{n_1}\leq c<a^{n_2}+b^{n_2}$.
  • Set $n=\frac{n_1+n_2}{2}$, and evaluate $a^{n}+b^{n}$.
  • If $a^{n}+b^{n} < c$, set $n_1$ to $n$. Otherwise, set $n_2$ to $n$.
  • Repeat step $1$.
5xum
  • 123,496
  • 6
  • 128
  • 204
0

Assume $a\ge b\ge 2$ and we are only interested in integer solutions $n$, we have \begin{equation} n\log a + \log(1 + (b/a)^n) = \log c \end{equation} but $(1 + (b/a)^n)$ is somewhere in $[1, 2]$, hence $ n \le \log_a c\le n + \log_a 2$. This implies \begin{equation} \boxed{n = \lfloor \log_a c\rfloor}\quad \text{if}\quad a > 2 \end{equation} \begin{equation} n = \lfloor\log_2 (c)\rfloor - 1\quad\text{if}\quad a = b = 2 \end{equation} It remains to say when this sole $n$ candidate actually satisfies the equation. If it does not, there is no solution.

Gribouillis
  • 14,188