TITLE: A closed formula for $A_n(X)=\sum\limits_{i=0}^n X^{i^2}$
QUESTION [9 upvotes]: I want to know if there exists a closed formula for sum $A_n(X)=\sum \limits_{i=0}^n X^{i^2}$.
I have found if n is odd then $(X^n+1)\text{ | } A_n(X)$, but I don't have found a closed formula.

REPLY [6 votes]: Not at all an answer, just observations. Firstly, a conjecture, based on experiment.
CONJECTURE $A_{2n}$ is irreducible for all $n.$
(empirically true for all $n\leq20.$)
CONJECTURE 2 $A_{2n+1}/(x^{2n+1}+1)$ has at most one non-cyclotomic factor.
(empirically true for all $n\leq 20$).
Finally, the roots of these things cluster around the unit circle (see the graphic for $A_{14}$).
Is it true that the zeros of the infinite series are on the unit circle?
(oops, this is not supposed to be a question).