Let $p$ be an odd prime, $g$ a primitive root of $p$, and
$f:\mathbb{Z}\times \mathbb{Z}\to \mathbb{Z}\_p$
is defined by
$$f(i,x) = g^{i+1} + g^{-i-1} - g^i x^2\mod p.$$


**Is it true that $f$ attains all values modulo $p$?**


It is not hard to see that $g^{i+1} + g^{-i-1}$ produces $(p+1)/2$ distinct values and $x^2$ produces $(p+1)/2$ distinct values. So, $g^{i+1} + g^{-i-1} - x^2$ does attain all values. Unfortunately, $g^i$ added to $x^2$ creates a twist.


I suspect that the statement is true -- I checked primes up to 3500 using a computer.



The range of values of $f(i,x) = g^{i+1} + g^{-i-1} - g^i x^2$ modulo a prime p
This is true.


Denote $g^{i+1}=y$, then $y$ takes any non-zero value mod $p$. Fix an element $a\in \mathbb{F}\_p$ and assume that the equation $y+1/y-g^{-1}yx^2=a$ does not have a solution. It yields that $y+1/y-a\ne g^{-1}yx^2$ for all $y\ne 0$ and all $x$. Thus, in particular, $y+1/y-a\ne 0$ for all $y\ne 0$, and for Legendre symbols we have $(\frac{y+1/y-a}p)=(\frac yp)$ (otherwise there exists $x$ such that $y+1/y-a=g^{-1}yx^2$). Therefore, $$(y+1/y-a)^{(p-1)/2}=y^{(p-1)/2}$$
for all non-zero $y$, and the polynomial
$$
f(y):=(y^2+1-ay)^{(p-1)/2}-y^{p-1}
$$
vanishes for all $y\ne 0$. But $\deg f<p-1$, so this may happen only if $f\equiv 0$. But $f(0)=1\ne 0$.


