Let $m,n$ are positive integers. a)Prove that $(m,n)=2\sum_{k=0}^{m-1}[\frac{kn}{m}]+m+n-mn$. b)If $m,n\geq 2$, prove that $\sum_{k=0}^{m-1}[\frac{kn}{m}]=\sum_{k=0}^{n-1}[\frac{km}{n}]$.
Problem
Source: 7-th Taiwanese Mathematical Olympiad 1998
Tags: function, number theory, greatest common divisor, number theory proposed