How can I find the coefficients of this logarithmic expression?

Knowing that $\log_{30}3=a$ and $\log_{30}5=b$, I would like to find $\log_{30}1350 = m$ in term $a$ and $b$. I tried

Clear[a, b]
a = Log[30, 3];
b = Log[30, 5];
SolveAlways[Log[30, 1350] == m a + n b  + p, {m, n, p}]


I can't get the values of $m$, $n$, $p$. How can I find the values of $m$, $n$, $p$?

• Please edit your question, which has $\log_{303} = a$ but no corresponding code. Also, please create a title that describes the content of your question to help in future searches. Dec 1, 2016 at 2:35
• @DavidG.Stork Edited. Thank you. Dec 1, 2016 at 2:37
• Hi; The simplest one I can find is Log[30, 1350] == 2 Log[30, 3] + Log[30, 5] + 1 Dec 1, 2016 at 3:24

Here are 3 ways to do it.

1350/30
FactorInteger[%]

(*
45
{{3, 2}, {5, 1}}
*)


Therefore $m=1+2a+b$.

You can also do:

Solve[(30^x) ( 3^y) ( 5^z) == 1350 && {x, y, z} >= 0, Integers]

(* {{x -> 1, y -> 2, z -> 1}} *)


yields the same solution.

Or again:

a := Log[30, 3]; b := Log[30, 5]; m := Log[30, 1350];
Solve[m == x + a y + b z && {x, y, z} >= 0, {x, y, z}, Integers]

(* {{x -> 1, y -> 2, z -> 1}} *)


Generalization. Of course this will also work if you replace $1350$ by another integer as long as it can be written as $30^x\times3^y\times5^z$.

• If x, y, z are reals number. How can I use your way? Dec 1, 2016 at 4:50
• @toandhsp If you allow $x,y,z$ to be real then a trivial solution is $m=\log_{30}1350 + 0\,a + 0\,b$.
– A.G.
Dec 1, 2016 at 5:11
Clear[a, b, m, n, p]
a = Log[30, 3];
b = Log[30, 5];
eqn = Log[30, 1350] == m*a + n*b + p;

fi = FindInstance[
eqn && Element[{m, n, p}, Integers] &&
0 < n && 0 < m && 0 < p,
{m, n, p}][[1]]

(*  {m -> 2, n -> 1, p -> 1}  *)

eqn /. fi // Simplify

(*  True  *)