Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer
fyi, FindInstance[(4/9) == (1/3)^n + (1/3)^m, {n, m}, Integers] also. – Nasser Jan 24 '14 at 16:43
Thanks! Had no idea that function existed. Mathematica is huge. – Brian Jan 24 '14 at 17:24
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. – bill s Jan 24 '14 at 17:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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