Recurrences & Generating Functions

Your answer
Answer & solution
Official answer: A
Write an=1+n for odd n and 1 for even n. The baseline generating function is 1/(1−x). Also Σ_(odd n≥1) n xn=x d/dx[x/(1−x²)]=x(1+x²)/(1−x²)². Adding gives 1/(1−x)+x(1+x²)/(1−x²)², option A.
The first coefficients are 1,2,1,4,1,6,… . Begin with the all-ones series, then add x+3x³+5x⁵+… . Differentiating x+x³+x⁵+…=x/(1−x²) and multiplying by x produces exactly that odd-index correction. This also checks that the constant coefficient remains 1.