Prove: if $n\mid 7^n+6^n$ and $n>1$, then $13\mid n$

Prove: if $n\mid 7^n+6^n$ and $n>1$, then $13\mid n$

Let $p$ be the least prime number such that $p\mid n$.

And I want to show that $p=13$

Let $d$ be the least number such that: $14^d\equiv 0 \pmod {p}$

And by Fermat's little theorem I have: $14^{p-1}\equiv 0 \pmod{p}$

Here I'm stuck


$n\mid 7^n\!+6^n\!=:a_n$ odd $\Rightarrow n$ odd, so $\,a_n = 7^n\!-\!(-6)^n,\,$ so $\,b,c= 7,-6\,$ below $\,\Rightarrow\, p = 13$.

Lemma $ $ If $\,\gcd(b,c)\!=\!1\ $ & $\ 1<n\mid b^n\!-c^n$ then $\,p\mid b\!-\!c\,$ for $\,\color{#c00}{p}=$ least prime factor of $\,n$.

Proof $\,\ \color{#f60}{p\nmid b}\,$ else $\,p\mid n\mid b^n\!-c^n\Rightarrow\,p\mid c,\,$ contra $\,\gcd(b,c)\!=\!1.\,$ $\color{#90f}{p\nmid c}\,$ by symmetry. If $\ \color{#0a0}{p\nmid b\!-\!c}\ $ $\rm\color{#90f}{then}$ $\!\bmod p\!:\ a:= \frac{b}c\!\not\equiv \color{#0a0}1,\color{#f60}0,$ and $\, a^n\equiv 1,\,$ so $\ {\rm ord}\ a\ge\color{#c00}p,\,$ contra $\ a^{p-1}\equiv 1\,$ by little Fermat, and the Order Theorem $\,(a^n\equiv 1\Rightarrow {\rm ord}(a)\,$ is a factor of $\, n;\,$ but $\,{\rm ord}(a)\neq 1$ by $\,\color{#0a0}{a\neq 1}\,$ so the least value $\,{\rm ord}(a)\,$ can take is the least factor $> 1\,$ of $\,n,\,$ which is its least prime factor $\,\color{#c00}p).$


Let $\,p\,$ be the least prime divisor of $\,n$

Observe $\,p\mid(6^n+7^n)(7^n-6^n)\,$ and little Fermat to obtain:

$p\mid 7^{2n}-6^{2n},\, 7^{p-1}-6^{p-1}\iff\, p\mid (7^{2n}-6^{2n},\, 7^{p-1}-6^{p-1})$

By below theorem and $\,(2n,p-1)=2\, $ we get $\,p\mid 7^2-6^2=13$

Theorem: $\,(a,b)=1,\,a>b\,\,\Rightarrow\,\, (a^m-b^m,a^n-b^n)=a^{(m,n)}-b^{(m,n)}$

Proof: Use $\,x^k-y^k=(x-y)(x^{k-1}+x^{k-2}y+\cdots+xy^{k-2}+x^{k-1})\,$

and $\gcd$ definition $n\mid a,b\iff n\mid (a,b)$ to prove:

$a^{(m,n)}-b^{(m,n)}\mid a^m-b^m,\, a^n-b^n\iff$

$a^{(m,n)}-b^{(m,n)}\mid (a^m-b^m,a^n-b^n)=: d\ \ \ (1)$

$a^m\equiv b^m,\, a^n\equiv b^n$ mod $d$ by definition of $d$.

Bezout's lemma gives $\,mx+ny=(m,n)\,$ for some $x,y\in\Bbb Z$.

$(a,b)=1\iff (a,d)=(b,d)=1$, so $(a^m)^x,(b^n)^y$ mod $d$ exist.

$a^{(m,n)}\equiv (a^{m})^x(a^n)^y\equiv (b^{m})^x(b^n)^y\equiv b^{(m,n)}\pmod{\! d}\ \ \ (2)$

$(1)(2)\,\Rightarrow\, a^{(m,n)}-b^{(m,n)}=d$