Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
add comment

1 Answer 1

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

Your Answer

 
discard

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.