How can we compute how many processes should be in memory at a time to make CPU utilization max?
Let $U$ indicate the CPU utilization in percent. What you have calculated is:
$$\log(U) = \log(1 - P^n) \stackrel{!}= \log(1) - \log(P^n) = \log(1) - n \log(P)$$

However, the equality marked with an exclamation mark is incorrect since $\log(a - b)$ is, in general, not equal to $\log(a) - \log(b)$. 

The correct line of reasoning is restating the original equality as $P^n = 1 - U$ and then: 
$$n \log(P) = \log(P^n) = \log(1 - U)$$
Thus: 
$$n = \frac{\log(1 - U)}{\log(P)}$$

(Of course, this all assuming $P &gt; 0$ and $U &lt; 1$; otherwise, there is no (unique) solution.)



Tip: when reformulating mathematical expressions, always do it one step at a time, and question every single step! Else you are bound to make mistakes. (Source: personal experience)