1) Note that:

Now by Euler's Theorem, separately: (*)

Consider (least common multiple). THis number satisfies by using (*) and knowing that is multiple of each of the exponents there.

That is: now since each of the divisors on the LHS are coprime to each other this implies that the product of them divides that is:

So we have: and thus

2) Remember that ( the product goes over the prime numbers dividing n)

Then we may write: (1)

So that: (2) now if: and since it follows that can have at most one odd prime divisor.

Thus: where is an odd prime

If then our (2) turns into thus:

Consider firsrt

The LHS of (1) is: if (see (1) ) and if

So we have got the solutions

If then and so either and then or and so (since q|6) and then

It remains to check what happens when n is a power of 2. In this case (1) turns into which is impossible. ANd so we have all the possible solutions