Problem

Source: 2023 Czech-Polish-Slovak Match Junior, individual p2 CPSJ

Tags: number theory, number of divisors



For a positive integer $n$, let $d(n)$ denote the number of positive divisors of $n$. Determine all positive integers $n$ for which $d(n)$ is the second largest divisor of $n$.