2

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

Bill Dubuque
  • 272,048
  • How is it possible? Look first at the case $n=2$. This is easy to understand. See also here, or better here. – Dietrich Burde Mar 16 '24 at 16:36
  • 1
    $\gcd(b_1, ..., b_n) = \gcd(b_1, \gcd(b_2, ..., b_n))$ so it follows by induction – Jakobian Mar 16 '24 at 16:41
  • @DietrichBurde I recognize that, but I just don't see how it generalizes to 3+ elements – LinguiniThePasta Mar 16 '24 at 16:42
  • It generalises by induction. – Dietrich Burde Mar 16 '24 at 16:42
  • $\gcd$ is just infimum in a certain partial order, and from that the equality I wrote above is obvious, it reads $\inf{b_1 \inf{b_2, ..., b_n}} = \inf{b_1, ..., b_n}$. – Jakobian Mar 16 '24 at 16:43
  • By the proof in the dupe, a gcd remains the same if we subtract one argument from any number of the others, so subtract $,{\rm arg}_1 = a_1$ from all args after it, then subtract the new $,{\rm arg}_2 = a_2$ from all args after it, etc, terminating with all $,{\rm arg}_k = a_k.,$ Or, simpler, working in reverse order: make each highest index $,{\rm arg}_k = a_k,$ by subtracting the prior arg, then do the same for the prior arg, etc. $\ \ $ – Bill Dubuque Mar 16 '24 at 19:59
  • The latter method boils down to $,(b_1,b_2,b_3,\ldots,b_n) = (b_1,, b_2!-!b_1,, b_3!-!b_2,\ldots, b_n!-!b_{n-1}),,$ in the OP special case $,b_1 = a_1,\ b_{n} = b_{n-1} + a_n,\ \ $ – Bill Dubuque Mar 16 '24 at 20:10
  • 1
    meanwhile, if $v$ is a column vector of integers with the gcd of them $g,$ and $M$ is a square matrix of integers with determinant $\pm 1,$ then the gcd of the elements in the column vector $Mv$ is also $g.$ Your matrix $M$ has all ones on or below the diagonal, all zero above the diagonal – Will Jagy Mar 16 '24 at 20:20
  • The two sequences are related linearly by a triangular integer matrix having ones in the diagonal and so is invertible. – lhf Mar 16 '24 at 20:27
  • 1
    The remarks in the prior two comments are clarified when one studies ideals, e.g. see unimodular transformations. The connection is that the ideal $(a_1,\ldots, a_n) = (d)$ is generated by any gcd $d$ of the $a_i$ because $\Bbb Z$ enjoys a Euclidean division (with remainder) algorithm (i.e. Euclidean $\Rightarrow$ PID). $\ \ $ – Bill Dubuque Mar 16 '24 at 21:00

1 Answers1

1

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$.

tth2507
  • 185