There are two little equations involving Euler's totient function which I'm not sure how to solve:

(a)Solve the equation $\displaystyle \phi(n)= 24$.

(b)Given that $\displaystyle n=3312913$ is a product of two primes and that $\displaystyle \phi(n)=3308580$, find the Prime factorisation of $\displaystyle n$without using a factorisation algorithm.

Attempt:

For(a)I know that if $\displaystyle n=p^k$ then the totient function is given by $\displaystyle \phi(n)=p^k -p^{k-1}$. And if n has prime factorization $\displaystyle n=p_1^{\alpha_1}...p_r^{\alpha_r}$, then it is given by:

$\displaystyle \phi(n)=n \left(1- \frac{1}{p_1} \right)... \left(1- \frac{1}{p_r} \right)$

So in this case we have

$\displaystyle 24 =3.2^3=\phi(n)= n \left(1- \frac{1}{p_1} \right)... \left(1- \frac{1}{p_r} \right)$

So, how should I work backward to find n?

For(b), since $\displaystyle n=pq$ where p & q (the question doesn't say if they are distinct) are primes we'll have:

$\displaystyle \phi(3312913)=3312913 \left(1- \frac{1}{p} \right) \left(1- \frac{1}{q} \right)$

Now, how can I tell what p and q are without factorizing n?

Any guidance is greatly appreciated.