If take a value for $k$, say not more than $k=4$; then the generating function (G.F.) needed is : $\frac{1-x^5}{1-x}$.
This confuses me as the G.F. given are :
$A(x) = 1+x+x^2+x^3+x^4+\cdots = \frac{1}{1-x}$
$B(x) = 1+x^5+x^{10}+x^{15}+x^{20}+\cdots = \frac{1}{1-x^5}$
The modified ratio $\frac{A'(x)}{B'(x)}$ gives some hint on working polynomial division with $22$ terms taken from numerator (let, $A'(x)$) and $4$ terms taken from denominator (let, $B'(x)$) as :
$\frac{A'(x)}{B'(x)} = \frac{1+x+x^2+x^3+x^4+x^5+x^6+x^7+\cdots +x^{21}+x^{22}}{1+x^5+x^{10}+x^{15}}= 1+x+x^2+x^3+x^4+ \frac{x^{21}+x^{22}}{1+x^5+x^{10}+x^{15}}$
So, if the terms on the numerator & denominator were taken indefinitely (as it should be), then the quotient should be the needed one, but is there any better / alternate way to see this.
This follows from the formula for a finite geometric series $$ 1+x+\dotsb+x^k=\frac{1-x^{k+1}}{1-x} $$ since $$ (1+x+\dotsb+x^k)(1-x)=(1+x+\dotsb+x^k)-(x+x^2+\dotsb +x^{k+1})=1-x^{k+1}. $$