\(B=\frac{1+x^2+x^4+...+x^{26}}{1+x^4+x^8+...+x^{24}}\)
\(=\frac{\frac{\left(x^2-1\right)\left(1+x^2+x^4+...+x^{26}\right)}{x^2-1}}{\frac{\left(x^4-1\right)\left(1+x^4+x^8+...+x^{24}\right)}{x^4-1}}\)
\(=\frac{\frac{x^{28}-1}{x^2-1}}{\frac{x^{28}-1}{x^4-1}}=\frac{x^4-1}{x^2-1}=x^2+1\)