Since 2n+7n≡1(modp), n must be odd. Let p be the least prime divisor of n. Hence (p,6)=1 and there exists x,y∈Z such that px+6y=1. Therefore 6y≡1(modp).
Let us consider a such that a≡7y(modp). Then an+1≡(7y)n+(6y)n(modp) and 7n+6n≡(7y)n+(6y)n(modp). Consequently an+1≡0(modp) and an≡−1(modp). Since n is odd (−a)n≡1(modp).
On the other hand (−a)p−1≡1(modp) by Fermat's theorem. Therefore (−a)(n,p−1)≡1(modp). Since p is least prime divisor of n we get (n,p−1)=1 and −a≡1(modp). From here we deduce 7y≡1(modp).
Finally −7⋅6y≡(mod⇒)−7≡6(modp)⇒13≡0(modp) and 13∣n.