Find the sum of all positive integers $n$ such that $\tau(n)^2 = 2n$, where $\tau(n)$ is the number of positive integers dividing $n$.

Let's think step by step and output the final answer within \boxed{}.
user