I am working with a prime field $\operatorname{GF}(p)$ where the prime $p$ has the form $p=kn+1$ for some $n$ that is a power of $2$.
My question: is it possible to devise an algebraic function over such a field that would map a specific number to $1$ and all other numbers to $0$. For example, $f_{23}(x)$ would evaluate to $1$ for $x = 23$ and to $0$ for all other $x$.
Somewhat related: I can use the following function to map all odd numbers to $1$ and all even numbers to $0$:
$$ f_{odd}(x) = \frac{1 - r^x}{2} $$
where $r$ is the $2^{nd}$ root of unity.