5
$\begingroup$

I am trying to solve the equation $(3^m - 3^n)^2 = 2^a + 2^b$ where $m, n, a, b$ be positive integers. I tried

Solve[{(3^m - 3^n)^2 == 2^a + 2^b, 1 <= n <= 10, 1 <= m <= 10, 
  1 <= a <= 20, 1 <= b <= 20}, {m, n, a, b}, Integers]

I can not get any solution. How can I solve it? I know that, $m=3$, $n=1$, $a=9$, and $b=6$ is a solution of the equation.

f[m_, n_, a_, b_] = (3^m - 3^n)^2 - 2^a - 2^b
f[3, 1, 9, 6]

0

$\endgroup$
2
  • 3
    $\begingroup$ f[{m_,n_,a_,b_}]:=(3^m-3^n)^2==2^a+2^b;Select[Tuples[Range[1,9],4],f] $\endgroup$
    – Bill
    Dec 2, 2023 at 4:20
  • 3
    $\begingroup$ Using f as defined by @Bill, Select[Tuples[ {Range[10], Range[10], Range[20], Range[20]}], f] Gives same result but checked full range of variables. $\endgroup$
    – Bob Hanlon
    Dec 2, 2023 at 7:05

1 Answer 1

5
$\begingroup$

The following succeeds:

NMinimize[{((3^m - 3^n)^2 - (2^a + 2^b))^2, 1 <= n <= 10, 
1 <= m <= 10, 1 <= a <= 20, 1 <= b <= 20, 
{m, n, a, b} \[Element] PositiveIntegers}, {m, n, a, b}]

{1.29247*10^-26, {m -> 1, n -> 3, a -> 9, b -> 6}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.