Let n=p1α1⋯pkαk. Then 8=(α1+1)⋯(αk+1), and 3240=p1−1p1α1+1−1⋯pk−1pkαk+1−1. Hence there are three cases:
(a) 8=α1+1⟹n=p7.
(b) 8=(α1+1)(α2+1)⟹n=p1p23.
(c) 8=(α1+1)(α2+1)(α3+1)⟹n=p1p2p3.
Then we check σ(n):
(a) 1+p2+⋯+p7=3240. We have 2<p<5, so p=3. But substituting yields no solution.
(b) (p1+1)(p23+p22+p2+1)=3240⟺(p1+1)(p2+1)(p22+1)=3240. First note that if q is an odd prime then, by Fermat's theorem, p22+1≡0(modq)⟹1≡p2q−1≡(−1)2q−1(modq)⟹q≡1(modq). Since 3240=23⋅34⋅5, the only primes that can divide p22+1 are 2 and 5. This leaves the possibilities p2=2 and p2=3, none of which yield a solution.
(c) (p1+1)(p2+1)(p3+1)=3240. Let's consider some cases.
(c.1) One of the primes pi is 2. Suppose that p1=2. Then (p2+1)(p3+1)=1080⟺(2p2+1)(2p3+1)=270.
Let x=2p2+1 and y=2p3+1. Then xy=270 is fixed and we want to minimize 2p2p3=2(2x−1)(2y−1)=8⋅270−4(x+y)+2, that is, we want to maximize x+y. This happens when ∣x−y∣ is maximum. Since p2 and p3 are primes, the optimal values for x and y are x=2 and y=135, that is, p2=3 and p3=269, leading to the minimal solution n=1614.
(c.2) All primes pi are odd. Then (2p1+1)(2p2+1)(2p3+1)=405=33⋅5. Then one prime, say p1, is equal to 2⋅3k⋅5−1=10⋅3k−1; and since 2pi+1 cannot be equal to 1, then they must have at least one factor 3 for i=2,3; there are only three factors 3, so k=0 or k=1. k=0 is not possible; k=1 yields p1=29 and (2p2+1)(2p3+1)=27⟹p2=5 and p3=17, leading to n=2465.
Hence the smallest value for n is 1614.