6. Let q=2m+1+1, by the condition we know 32m≡−1(modq), hence 32m+1≡1(mod q). This indicates δq(3)∣2m+1, but δq(3)×2m. Therefore, δq(3)=2m+1.
On the other hand, by Euler's theorem, we know 3φ(q)≡1(modq), so 2m+1∣φ(q), i.e., (q−1)∣φ(q). Combining φ(q)⩽q−1, we know φ(q)=q−1, thus q is a prime.