I'm aware that prime factors of $n^2+1$ take the form $4k+1$. It's also well known that factors dividing $\frac{a^p \pm 1}{a \pm 1}$ will be congruent to $2kp+1$. Fibonacci and some other recurrence relations constrain prime factors to $n \pm 1$ for relevant $n$.
Are there any other general tricks for generating numbers whose prime factors are constrained?