Let $X$ be an affine variety defined over $\mathbb{Z}$ and let $G$ be an algebraic group defined over $\mathbb{Z}$. Let $q$ be a power of a prime number. We write $\mathbb{F}_q$ for the field with $q$ elements and we define $$n_q:= \text{number of } G(\mathbb{F}_q) \text{ orbits in } X(\mathbb{F}_q).$$
Question 1: Under what condition $n_q$ has a closed formula which is a polynomial in $q$?
Question 2: In case of a positive answer for Question 1, do the coefficients of this polynomial relate to any known invariants of $X$ and $G$?
Question 3: given a polynomial with rational coefficients, is there any way to detect if it arises in the above situation?