We were given this question on one of our recent exams, and we can't seem to generate a proof, nor find a counter-example.
If we let $\sigma(n)$ be the sum of the divisors of $n$, the question is, if
$$\sigma(n)=2^k$$
for some $k$, does this imply $n$ is square free?
This is clearly true if we consider just the number of divisors being a power of two, but we cannot extend it to the sum of the divisors. We have tried numerous $n$ that are not square-free, and none have given a counter-example. We made some progress in noting that if
$$n=p_1^{k_1}p_2^{k_2}...p_j^{k_j}$$
is the prime factorization of $n$, then
$$2^k=\sigma(n)=(1+p_1+p_1^2+...+p_1^{k_1})...(1+p_j+p_j^2+...+p_j^{k_j})$$
This then implies that each factor must be a power of two itself, and thus for each $p_i$,
$$p_i+p_i^2+...+p_i^{k_i}=2^t-1$$
for some $t$. Even with this, we are unable to find a counter-example. There does not seem to be a non-trivial solution.
Is there a proof we can't see, or is there a counter-example we can't find?
EDIT: From a comment by @lulu $\sigma(n)=2^k$ when $n$ is a product of distinct Mersenne primes, and is thus square-free. Since we have not covered these in our class, I'm still open to other solutions.
Mersenne prime is a prime number that can be written in the form Mn = 2^n − 1 for some integer n. mersenne numbers are all integers of that same form including the ones that fail primality test .