How to prove that $\text{gcd}(a_1, a_2, ..., a_n) = \text{gcd}(a_1, a_1 + a_2, ..., a_1 + a_2 + ... + a_n)$

65 Views Asked by At

How is it possible that $\text{gcd}(a_1, a_2, ..., a_n) = \text{gcd}(a_1, a_1 + a_2, ..., a_1 + a_2 + ... + a_n)$? This is not a homework or anything so an intuitive proof would be enough, but I can't seem to wrap my head around it. I found this proposition on a codeforces problem: Solution Statement

The problem is here: https://codeforces.com/contest/1925/problem/B

1

There are 1 best solutions below

0
On

The greatest common divisor of a set of natural numbers $\{a_1,\dots,a_n\}\subseteq\mathbb N$ is defined as $$ \gcd(a_1,\dots,a_n)=\max\left\{k\in\mathbb N~\middle|~\forall i\in\{1,\dots,k\}: n\text{ divides }a_i\right\} $$ To show $\leq$ in your desired equality, you therefore have to show that every natural number that divided $a_1,\dots,a_n$ also divides $a_1,a_1+a_2,\dots,a_1+\dots+a_n$. This follows since if $k$ divides $x$ and $y$ it also divides $x+y$.
Showing $\geq$ is a bit more complicated: Let $k\in\mathbb N$ such that $k$ divides all of $a_1,a_1+a_2,\dots,a_1+\dots+a_n$. By definition, $k$ divides $a_1$. Since $k$ divides $a_1$ and $a_1+a_2$ it also needs to divide $a_2=(a_1+a_2)-a_1$. Since $k$ divides $a_1+a_2$ and $a_1+a_2+a_3$ it similarly needs to divide $a_3$. Continuing in this manner shows that $k$ divides all of $a_1,\dots,a_n$.