Let's prove by induction that both an is an integer and gcd(an,an−1)=gcd(an,an−2)=gcd(an,an−3)=1. It is certainly true for n=3 and direct substitutions show that it is true for n≤7. Suppose that it's true for n≤k. First we prove that ak+1 is an integer by showing that ak−3∣akak−2+ak−12.
In fact,
ak−2ak+ak−12=ak−6ak−5ak−3+ak−42⋅ak−4ak−3ak−1+ak−22+(ak−5ak−4ak−2+ak−32)2=ak−4ak−6ak−52ak−52(ak−5ak−3+ak−42)⋅(ak−3ak−1+ak−22)+ak−4ak−6(ak−4ak−2+ak−32)2
Reducing modulo ak−3 and noting that gcd(ak−3,ak−4)=gcd(ak−3,ak−5)=gcd(ak−3,ak−6)=1 by induction hypothesis, this is equivalent to prove that
ak−22ak−42(ak−52+ak−4ak−6)≡0(modak−3)
But ak−52+ak−4ak−6=ak−3ak−7, so ak−3∣akak−2+ak−12.
Now the gcd part. Notice that
gcd(ak+1,ak)=gcd(ak−4akak−2+ak−12,ak)≤gcd(akak−2+ak−12,ak)=gcd(ak−12,ak)=1
where the last equality follows from the induction hypothesis. The other equalities follow similarly:
gcd(ak+1,ak−1)≤gcd(akak−2+ak−12,ak−1)=gcd(a2ak−2,ak−1)=1
gcd(ak+1,ak−2)≤gcd(akak−2+ak−12,ak−2)=gcd(ak−12,ak−1)=1
and the induction step is complete.