Let ∏i=1mxi denote the product of m real numbers x1,x2,…,xm. For any positive integer N, let ord2N denote the maximum nonnegative integer ℓ such that 2ℓ divides N.
n=1 does not meet the assumption since d(1)51ϕ(1)−1=0 is an integer. In the following we assume n≥2. If distinct prime numbers p1,p2,…,pk and positive integers e1,e2,…,ek satisfy n=∏i=1kpiei, then ϕ(n)=∏i=1kpiei−1(pi−1).
When n is even, the assumption that nϕ(n)d(n)+1 is an integer implies that ϕ(n) is odd, thus n=2. On the other hand, n=2 satisfies the assumptions since 2ϕ(2)d(2)+1=212+1=1 and d(2)52ϕ(2)−1=2521−1=321.
In the following we assume n is odd and n≥3. The assumption that nϕ(n)d(n)+1 is an integer implies that n and ϕ(n) are coprime, thus n is square-free. Then n=∏i=1kpi with distinct odd primes p1,…,pk, thus d(n)=2k. Now we need the following lemma.
Lemma. For any odd integer x≥3 and any positive integer y, there holds ord2(xy−1)≥ord2(x−1)+ord2y.
Proof. Suppose y=2v⋅s with a nonnegative integer v and a positive odd integer s. Then xy−1=(xs−1)∏i=0v−1(x2i⋅s+1). Since xs−1=(x−1)(xs−1+⋯+x+1), ord2(xs−1)≥ord2(x−1).
Also, ord2(x2i⋅s+1)≥1 for any i since x is odd, thus we obtain ord2(∏i=0v−1(x2i⋅s+1))≥v.
Hence ord2(xy−1)≥ord2(x−1)+ord2y. ■
The condition that d(n)5nϕ(n)−1=25knϕ(n)−1 is not an integer is equivalent to ord2(nϕ(n)−1)<5k. The above lemma implies that ord2(nϕ(n)−1)≥ord2(n−1)+ord2(ϕ(n)). Since nϕ(n)d(n)+1 is an integer, for any pi there holds ϕ(n)2k≡−1(modpi), thus ϕ(n)2k+1≡1(modpi). Let ti be the minimum positive integer t such that ϕ(n)t≡1(modpi). If a positive integer ℓ satisfies ϕ(n)ℓ≡1(modpi), then ti divides ℓ; this is because when r denotes the remainder of ℓ modulo ti, then ϕ(n)ℓ≡ϕ(n)r≡1(modpi), which implies r=0 by the minimality of ti. Now ti divides 2k+1 since ϕ(n)2k+1≡1(modpi). On the other hand ti does not divide 2k since ϕ(n)2k≡−1≡1(modpi). Hence we obtain ti=2k+1.
By the Fermat's little theorem ϕ(n)pi−1≡1(modpi), thus 2k+1 divides pi−1. Hence ord2(ϕ(n))=∑i=1kord2(pi−1)≥k(k+1). On the other hand, by n−1=∏i=1kpi−1≡∏i=1k1−1≡0(mod2k+1) we obtain ord2(n−1)≥k+1. Therefore 5k>ord2(nϕ(n)−1)≥ord2(n−1)+ord2(ϕ(n))≥(k+1)2. Then we obtain k=1,2.
When k=1 we obtain ϕ(n)=n−1 and d(n)=2, thus nϕ(n)d(n)+1=n(n−1)2+1=n−2+n2 is not an integer, which contradicts the assumption. When k=2, the condition 3+2⋅3≤ord2(n−1)+ord2(ϕ(n))<5⋅2 implies that ord2(n−1)=3 and ord2(ϕ(n))=6. Since p1−1 and p2−1 are both multiples of 22+1, ord2((p1−1)(p2−1))=ord2(ϕ(n))=6 implies ord2(p1−1)=ord2(p2−1)=3. Thus p1≡p2≡9(mod16). Hence n−1=p1p2−1≡0 (mod 16), which contradicts ord2(n−1)=3. Thus there does not exist an odd integer n≥3 which satisfies the required conditions.
Hence the answer is n=2.