Let $a$ and $b$ be integers. Since $\mathbb{Z}a+\mathbb{Z}b$ is an ideal of $(\mathbb{Z},+,\cdot)$, $\exists n\geq 0$ s.t. $\mathbb{Z}a+\mathbb{Z}b=\mathbb{Z}n$. Prove that $n=\gcd(a,b)$ (therefore, $\exists f,e\in\mathbb{Z}$ s.t. $ea+fb=\gcd(a,b)$).
I'm having trouble with this one. I know that given a ring $A$ and an ideal $A\alpha_i$, we have that $$\sum_{i=1}^{t}A\alpha_i := \left\{\sum_{i=1}^{t}a_i\alpha_i \biggr\rvert a_1,\cdots, a_t\in A\right\}\quad.$$ This means that $\mathbb{Z}a+\mathbb{Z}b=\{z_1a+z_2b\;|\;z_1,z_2\in\mathbb{Z}\}$. But then $\exists z\in\mathbb{Z}$ s.t. $\mathbb{Z}a+\mathbb{Z}b = \{z(a+b)\;|\;z\in\mathbb{Z}\}$, but $a+b\neq\gcd(a,b)$. What am I missing here?