Proving that $\gcd(5^{98} + 3, \; 5^{99} + 1) = 14$ 
Prove that $\gcd(5^{98} + 3, \; 5^{99} + 1) = 14$.

I know that for proving the $\gcd(a,b) = c$ you need to prove 


*

*$c|a$ and $c|b$

*$c$ is the greatest number that divides $a$ and $b$ 
Number 2 is what I'm struggling with. Does anybody have any ideas?
 A: Hint $\rm\  mod\ {n\!+\!3\!}:\,\ \color{#C00}{n\!\equiv -3}\:\Rightarrow\: \color{#0A0}{5n\!+\!1}\!\equiv 5\color{#C00}{n}\!+\!1\equiv 5(\color{#C00}{-3})\!+\!1\equiv \color{#0A0}{-14}.\ $ Therefore
$\rm\qquad\ \ \ \ (n\!+\!3, \color{#0A0}{5n\!+\!1}) =  (n\!+\!3,\ \color{#0A0}{5n\!+\!1}\ mod\ n\!+\!3) = (n\!+\!3, \color{#0A0}{14})\ \ [ = 14\ \ if\ \ 14\mid n\!+\!3]$
since we have $\rm\ (a,\color{#0A0}b) =\, (a,\, \color{#0A0}b\ mod\ a)\ \ $ [modular gcd law, heart of Euclidean algorithm]
Yours is special case $\rm\ n = 5^{98}.$ Then $\rm\:14\mid n\!+\!3\:$ since  $\rm\:2,7\mid 5^{98}\!+\!3,\:$ since $\rm\:n\!+\!3\:$ is even, and by little Fermat $\rm\:mod\ 7\!:\ \color{#C00}{5^6\equiv 1}\:\Rightarrow\: 5^{98}\!\equiv 5^{2+6(16)}\!\equiv 5^2 (\color{#C00}{5^6})^{16}\!\equiv 5^2\color{#C00}{1}^{16}\!\equiv \color{#0A0}4\:$ so $\rm\:5^{98}\!+\!3\equiv \color{#0A0}4\!+\!3\equiv 0.$
Remark $\ $ More generally, a similar proof shows that, for any polynomial $\rm\:f(x)\in \Bbb Z[x],$
$\rm\qquad mod\ n\!-\!a\!:\ n\equiv a\:\Rightarrow\: f(n)\equiv f(a)\ \Rightarrow\ (n\!-\!a,f(n)) = (n\!-\!a,f(a))\:$  
In particular $\rm\:(n\!+\!3,f(n)) = (n\!+\!3,f(-3)),\:$ so $\rm\:f(n) = 5n\!+\!3\:$ gives your case.
If such congruence arithmetic is unfamiliar then you can replace it by the Factor Theorem, which implies that when $\rm\:f(n)\:$ is divided by $\rm\:n\!-\!a\:$ it has remainder $\rm\:f(a),\:$ since, by the polynomial Division Algorithm, $\rm\:f(x) = (x\!-\!a)g(x) + k,\:$ for $\rm\:k\in\Bbb Z,\ g\in \Bbb Z[x].\:$ Evaluation at $\rm\:x = a\:$ shows $\rm\:k = f(a).\:$ Then evaluating at $\rm\:x = n\:$ shows  $\rm\:f(n) = (n\!-\!a) g(n) + f(a),\:$ hence $\rm\:f(n)\:$ and $\rm\:f(a)\:$ have the same remainder when divided by $\rm\:n\!-\!a,\:$ since they differ by an integer multiple of $\rm\:n\!-\!a.\:$
A: Hint: for the part you're struggling with, note $\gcd(a,b) = \gcd(a-b, b)=\gcd(a-5b, b)$. 
A: Hint: Use the Euclidean algorithm
A: First of all, $$5\cdot(5^{98}+3)-1\cdot(5^{99}+1)=14$$
$$\implies (5^{98}+3,5^{99}+1)\mid 14$$
Now both the numbers are even $\implies 2\mid (5^{98}+3,5^{99}+1) $
Using Fermat’s Little theorem $5^6\equiv1\pmod 7$
$\implies 5^{98}=(5^6)^{16}\cdot5^2\equiv 25\pmod 7\equiv-3\implies 7\mid (5^{98}+3)$
and $5^{99}\equiv(5^6)^{16}\cdot5^3\equiv125\pmod 7\equiv-1 \implies 7\mid (5^{99}+1)$
$\implies 7\mid (5^{98}+3,5^{99}+1) $
$\implies (5^{98}+3,5^{99}+1)$ is divisible by lcm$(2,7)=14$
A: What you write is a correct definition of the GCD.  We can, in fact, compute it in the manner you describe by finding the prime factorisation.
Prime factorisation
We factorise the two numbers.  In this case, we find $$5^{98}+3=2^2 \cdot 7 \cdot 261031 \cdot 1926487 \cdot 46776900545688835975094119 \cdot 479085229840977695707830010807$$ and $$5^{99}+1=2 \cdot 3^3 \cdot 7 \cdot 23 \cdot 67 \cdot 5167 \cdot 5281 \cdot 595123 \cdot 190771747 \cdot 874300184250616439267985523227691404297001.$$ (Computed using Alpertron.)
From here, we can "read off" the GCD as $2 \cdot 7=14$, since none of the larger primes divide both numbers.  In general, $$\gcd(a,b)=\prod_{\text{prime } p} p^{\min(x_p,y_p)}$$ where $x_p$ and $y_p$ are respectively the largest non-negative integers such that $p^{x_p}$ and $p^{y_p}$ divides $a$ and $b$, respectively.
As you might know, computing the prime factorisation of numbers is generally considered hard.  If the numbers you had were much larger, factoring them might not have been possible (on today's hardware).  Fortunately, for computing the GCD there is a much more efficient method...
Euclid's Algorithm
Euclid's Algorithm is an efficient method for computing the GCD of two numbers by recursively using the identity $$\gcd(a,b)=\gcd(a-b,b).$$  It is one of the most important algorithms in number theory, from both a theoretical and practical viewpoint.
This is what the other answers are pointing at, and is probably what your teacher intends that you learn by asking you this question.
A: By euclid's algorithm $$\begin{align}gcd(5^{98}+3,5^{99}+1) &= gcd(5^{98}+3,5^{99}-1-5*(5^{98}-3))
\\ & =gcd(5^{98}+3,14)\end{align}$$Now we can see that 2 divides $5^{98}+3$. Also $5^3$ is -$1 (mod 7)$. Therefore $5^{98}=5^2*5^{96}=4(mod 7)$. So $5^{98}+3=0(mod 7)$. Hence 14 divides $5^{98}+3$. So $gcd(5^{98}+3,14)=14.$
A: Are you allowed to use Fermat's Little theorem?
$5^{\phi(14)} = 5^6 \equiv 1 \mod 14$
$5^{98} \equiv 5^{96}5^2 \equiv 25 \equiv -3 \mod 14$ so $14|5^{98} + 3$
and $5^{99} \equiv -3*5 \equiv -15 \equiv -1 \mod 14$ so $14|5^{99} + 1$
So $14$ is a common divisor.
Hmm, but how to show it is the greatest common divisor?
Well, we know  $14|\gcd(5^{98} + 3, 5^{99} + 1)$
And we can see $5 \not \mid 5^{98} + 3$ nor $5^{99}+1$ 
so $\gcd(5^{98} + 3, 5^{99} + 1) = \gcd(5^{98} + 3, [5^{99} + 1] - 5[5^{98} + 3])$
$= \gcd(5^{98} + 3, [5^{99} + 1] - [5^{99} + 15]) = \gcd(5^{98} + 3, - 14)$
$\gcd(5^{98} + 3, 14)$
So $\gcd(5^{98} + 3, 5^{99} + 1)|14$ and $14|\gcd(5^{98} + 3, 5^{99} + 1)$.
So $14 = \gcd(5^{98} + 3, 5^{99} + 1)$.
