Proving two equations involving the greatest common divisor 
Show or prove that $$\gcd \left(\frac{a^{2m}-1}{a+1} ,a + 1\right )=\gcd(a + 1 , 2m),$$
  and that
  $$\gcd \left(\frac{a^{2m + 1}+1}{a+1} , a + 1\right)=\gcd(a + 1 , 2m + 1).$$


I will show that $$\gcd \left(\frac{a^{2m}-1}{a+1} ,a + 1\right )=\gcd(a + 1 , 2m)$$
First note that $$a^{2m}-1=(a^2)^m-1=(a^2-1)(a^{2(m-1)}+
a^{2(m-2)}+\cdots+1)$$
so that $$\frac{a^{2m}-1}{a+1}=(a-1)(a^{2(m-1)}+\cdots+1)$$
But $a\equiv -1 \mod a+1$ so we have
$$\frac{a^{2m}-1}{a+1}\equiv -2((-1)^{2(m-1)}+\cdots+1)=-2m$$
which means $$\gcd \left(\frac{a^{2m}-1}{a+1} ,a + 1\right )=\gcd(a + 1 , 2m)$$
Can you do something similar with the other?
