A couple of examples from quadratic residue patterns modulo primes:
Example 1. Let p be a large prime. How many elements x(modp) are there such that both x and x+1 are quadratic residues?
Since half of elements mod p are quadratic residues and the events ”x is a QR” and ”x+1 is a QR” look like they are independent, a reasonable guess is p/4. This is the correct main term, but what about the error? A natural square-root error term is not right: one can show that the error is O(1), the error depending only on whether p is 1 or 3 mod 4. (The proof is by elementary manipulations with the Legendre symbol, see here. So there’s hidden structure that makes the error smaller than what a naive randomness heuristic suggests.)
Example 2. Let p be a large prime. How many elements x(modp) are such that all of x,x+1 and x+2 are quadratic residues?
Again, the obvious guess for the main term is correct (there are roughly p/8 such x), so consider the error term. The error is not O(1) this time! The next guess is a square-root error term. Perhaps as p ranges over the primes, the error term is (after suitable normalization) normally distributed (as is motivated by the central limit theorems)? This is not correct either!
The error is in fact bounded in absolute value by √p/4, following from a bound on the number of points on elliptic curves modulo p. And for the distribution of the error, if one normalizes the error by dividing by √p/4 (so that the resulting value is in [−1,1]), the distribution behaves like cos(U), where U is uniformly distributed on [−π,π] as p ranges over the primes (see here). This is a deep result, which is not easy to motivate in a couple of sentences, but again there’s hidden structure that the naive randomness heuristic does not account for.
(And no, one does not get normal distribution for longer streaks of quadratic residues either.)
A couple of examples from quadratic residue patterns modulo primes:
Example 1. Let p be a large prime. How many elements x(modp) are there such that both x and x+1 are quadratic residues?
Since half of elements mod p are quadratic residues and the events ”x is a QR” and ”x+1 is a QR” look like they are independent, a reasonable guess is p/4. This is the correct main term, but what about the error? A natural square-root error term is not right: one can show that the error is O(1), the error depending only on whether p is 1 or 3 mod 4. (The proof is by elementary manipulations with the Legendre symbol, see here. So there’s hidden structure that makes the error smaller than what a naive randomness heuristic suggests.)
Example 2. Let p be a large prime. How many elements x(modp) are such that all of x,x+1 and x+2 are quadratic residues?
Again, the obvious guess for the main term is correct (there are roughly p/8 such x), so consider the error term. The error is not O(1) this time! The next guess is a square-root error term. Perhaps as p ranges over the primes, the error term is (after suitable normalization) normally distributed (as is motivated by the central limit theorems)? This is not correct either!
The error is in fact bounded in absolute value by √p/4, following from a bound on the number of points on elliptic curves modulo p. And for the distribution of the error, if one normalizes the error by dividing by √p/4 (so that the resulting value is in [−1,1]), the distribution behaves like cos(U), where U is uniformly distributed on [−π,π] as p ranges over the primes (see here). This is a deep result, which is not easy to motivate in a couple of sentences, but again there’s hidden structure that the naive randomness heuristic does not account for.
(And no, one does not get normal distribution for longer streaks of quadratic residues either.)