To start with, note that, since is either 1 or an even number, n must be even.
Remember that: (the products go over the prime numbers p dividing n)
Now since 3 is a prime number, and it follows that 3 is one of the prime factors in the product. Thus: and 2|n thus: and this is only possible if there are no other prime factors.
And conversely this number satisfies the condition for any