I am trying to solve the equation

$\frac{4}{9} = \big( \frac{1}{3} \big) ^n + \big( \frac{1}{3} \big) ^m $

with $n$ and $m$ both positive integers.

I type into Mathematica the following

In:= Solve[4/9 == 1/3^m + 1/3^n && m > 0 && n > 0, n, Integers]

which spits out "Solve::nsmet: This system cannot be solved with the methods available to Solve."

The solution to the problem is $n=1\:\&\:m=2$ or $n=2\:\&\:m=1$. How can I change my input to have Mathematica come up with this?


1 Answer 1


One approach is to ask for an answer using FindInstance

FindInstance[4/9 == (1/3)^m + (1/3)^n && m > 0 && n > 0, {n, m}]
{{n -> 2, m -> 1}}

As Nasser points out in the comment, you can replace the requirements that m>0 and n>0 by insisting that n and m are integers:

FindInstance[(4/9) == (1/3)^n + (1/3)^m, {n, m}, Integers]

Both give the same answer.

  • 2
    $\begingroup$ fyi, FindInstance[(4/9) == (1/3)^n + (1/3)^m, {n, m}, Integers] also. $\endgroup$
    – Nasser
    Commented Jan 24, 2014 at 16:43
  • $\begingroup$ Thanks! Had no idea that function existed. Mathematica is huge. $\endgroup$
    – Brian
    Commented Jan 24, 2014 at 17:24
  • $\begingroup$ Solve, FindInstance, and Reduce are all devoted to this kind of thing. I always try out all three -- in this case, FindInstance was the most useful. $\endgroup$
    – bill s
    Commented Jan 24, 2014 at 17:29

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.