For positive integer n, let d(n) denote the number of positive divisors of n (including 1 and n itself).
Firstly, note that 1 and 2 are good, since 1=d(2)2 and
2=d(8)8.
Secondly, we note that if p is an odd prime, then p is good. This is because d(8p)=8. In particular, 3,5,7,11,13,17 are good numbers.
Thirdly, we note that if p is an odd prime, then 2p is good. This is because d(22⋅32p)=3⋅3⋅2. In particular, 6,10,14 are good numbers.
Fourthly, we note that
4=d(36)36,8=d(96)96,9=d(108)108,
12=d(240)240,15=d(360)360,16=d(128)128.
Thus, the numbers 1,2,…,17 are good.
Finally, we prove that 18 is not good. We approach indirectly by assuming that 18=d(n)n or n=18d(n) for n=2a⋅3b+1⋅p1k1⋯pmkm (where p1<⋯<pm are prime numbers greater than 3 and a,b,k1,⋯,km are positive integers); that is,
2a−1⋅3b−1⋅p1k1⋯pmkm=(a+1)(b+2)(k1+1)⋯(km+1).1◯
For every odd prime p and every positive integer k, we can show (by an easy induction on k) that
pk>k+1.2◯
Combining the last two relations, we deduce that
2a−1⋅3b−1<(a+1)(b+2)
or
f(a)=a+12a−1<3b−1b+2=g(b).
It is easy to prove that f(1)=21, f(2)=32, f(3)=1, f(4)=58, f(5)=616, and f(a)≥732>4 for a≥6. It is also easy to prove that g(1)=3, g(2)=34, g(3)<95, and g(b)<92 for b≥4. Thus 1◯ holds only if b≤3.
If b=3, then (a,b)=(1,3), and 1◯ becomes
9p1k1⋯pmkm=10(k1+1)⋯(km+1),
implying that p1=5. Since 2◯ and k1+1p1k1=k1+15k1≥25 for positive integer k1≥1, we can easily see that there is no solution in this case.
If b=2, then (a,b)=(1,2), (2,2), (3,2), and 1◯ becomes
3⋅2a−1p1k1⋯pmkm=4(a+1)(k1+1)⋯(km+1).
We deduce that 4 divides 2a−1 or a≥3. Hence a must be equal to 3. But then 4(a+1)=16 divides 2a−1, which is impossible.
If b=1, then (a,b)=(1,1), (2,1), (3,1), (4,1), (5,1), and 1◯ becomes
2a−1p1k1⋯pmkm=3(a+1)(k1+1)⋯(km+1),
which is impossible since pi are primes greater than 3.
In all the cases, we cannot find n satisfying the condition 18=d(n)n; that is, 18 is not a good number.