2. Alessandra writes on Luigi's notebook all natural numbers $n$ that have both of the following properties: $n$ has exactly 4 positive divisors (including 1 and $n$ itself), and the sum of the positive divisors of $n$ is 42. What is the sum of all the numbers written by Alessandra?
(A) 0
(B) 12
(C) 20
(D) 26
(E) 42
2. The answer is (D). If $n$ has four positive divisors, they are, in ascending order, $1, p, q, n$ with $p$ being a prime number.

If $q$ is a prime number, we can conclude that $n=p \cdot q$, because $n$ has no other divisors. The sum of the positive divisors is $1+p+q+p \cdot q=(1+p)+q(1+p)=(1+p)(1+q)$, which by hypothesis must equal $42=2 \cdot 3 \cdot 7$. Neither $(1+p)$ nor $(1+q)$ can be equal to 1, and neither can they be equal to 42, otherwise the other would be equal to 1. Since 42 has only three prime factors, one of them must be equal to $(1+p)$ or $(1+q)$, and thus it must still be prime when decreased by one. The only possibility is therefore that $p+1=3$ and $q+1=2 \cdot 7=14$. Since $p=3-1=2$ and $q=14-1=13$ are primes, $n=2 \cdot 13=26$ has the desired properties.

Now consider the other possibility, that $q$ is not a prime number. Then $q$ has as divisors only $1, p$, and itself, otherwise other divisors would also divide $n$. Thus, $q=p^{2}$ and $n=p^{3}$. The sum of the positive divisors is $1+p+p^{2}+p^{3}=1+p\left(1+p+p^{2}\right)=42$, so $p\left(1+p+p^{2}\right)=41$. But since 41 is a prime number, in this case there are no solutions.