They're asking for integers, not primes. $171$ divides $2^{171}+1$, for example. The number $n$ can be a product of primes in $1$ and $3$ modulo $8$, as would its period. The answers that i have seen in the url above and the previous question consider only primes, not composite integers.
– wendy.kriegerJun 29 '13 at 08:59
1
@wendy.krieger But $171^2 \not\mid 2^{171}+1$, which is what the question is asking about. The solution posted to the duplicate is indeed correct for all $n$. It uses a prime factor of $n$, which is guaranteed to exist.
– Alex BeckerJun 29 '13 at 18:16
@AlexBecker But it only handles base $2$, and some of the versions are seriously flawed and all are overly complex. A general proof and construction is given for all $b$, including $10$.
– wendy.kriegerJun 30 '13 at 08:03