6. Given the line $6 x-5 y-28=0$ and

the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1\left(a>b>0\right.$, and $\left.a^{2} 、 b \in \mathbf{Z}\right)$
intersect at points $A$ and $C$. Let $B(0, b)$ be the upper vertex of the ellipse, and the centroid of $\triangle A B C$ is the right focus $F_{2}$ of the ellipse. Then the equation of the ellipse is $\qquad$.
6. $\frac{x^{2}}{20}+\frac{y^{2}}{16}=1$.

Let $A\left(x_{1}, y_{1}\right), C\left(x_{2}, y_{2}\right)$.
From the problem, we know that the centroid of $\triangle A B C$ is the right focus $F_{2}$ of the ellipse, which simplifies to
$$
\begin{array}{l}
x_{2}+x_{1}=3 c, \\
y_{2}+y_{1}=-b .
\end{array}
$$

Since points $A$ and $C$ lie on the given line, we have
$$
\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{6}{5} \text {. }
$$

Since points $A$ and $C$ lie on the ellipse, we have
$$
\frac{x_{1}^{2}}{a^{2}}+\frac{y_{1}^{2}}{b^{2}}=1, \frac{x_{2}^{2}}{a^{2}}+\frac{y_{2}^{2}}{b^{2}}=1 \text {. }
$$

Subtracting the two equations and simplifying, we get
$$
\begin{array}{l}
-\frac{b^{2}}{a^{2}}=\frac{\left(y_{2}+y_{1}\right)\left(y_{2}-y_{1}\right)}{\left(x_{2}+x_{1}\right)\left(x_{2}-x_{1}\right)}=\frac{-b}{3 c} \cdot \frac{6}{5} \\
\Rightarrow 2 a^{2}=5 b c .
\end{array}
$$

Since points $A$ and $C$ lie on the given line, we have
$$
6 x_{1}-5 y_{1}-28=0,6 x_{2}-5 y_{2}-28=0 \text {. }
$$

Combining equations (1) and (2), we get
$$
\begin{array}{l}
6 \times 3 c-5(-b)-56=0 \\
\Rightarrow 18 c+5 b=56 .
\end{array}
$$

Solving equations (3) and (4) together, and given that $a^{2}$ and $b$ are integers, we find $c=2, b=4, a^{2}=20$.
Thus, the equation of the ellipse is $\frac{x^{2}}{20}+\frac{y^{2}}{16}=1$.