TITLE: Number of $\mathbb F_p$ points constant mod $p$?
QUESTION [15 upvotes]: I have some affine varieties $X$ defined over $\mathbb Z$, and associated integers $c(X)$, with the property that $\# X_{\mathbb Z/p} \equiv c(X) \bmod p$ for all $p$. (In particular $c(X)$ is usually $1$ in my examples, but not always.) 

Is this property related to any other interesting properties of $X$, e.g. "ordinary", "unirational", etc.?

I am happy to entertain conjectures, necessary conditions, sufficient conditions, anything. I looked at the 33 occurrences of the word "constant" in Serre's Lectures on $N_X(p)$, but haven't delved deeper into that book.

REPLY [5 votes]: Nobody seems to have mentioned Fulton's (?) trace formula. It says that the number of points mod p equals the alternating trace of Frobenius on coherent cohomology $H^i(X, \mathcal{O})$.  So - and this is probably exactly the same as Sawin's point- the easiest reason that the number of points is congruent to $1$ modulo $p$ is that all the higher cohomology of the structure sheaf vanishes.