This question is, admittedly, somewhat poorly-posed (and for that reason I would be very receptive to anyone who can suggest ways to improve it).
I have recently been thinking about the following question:
Choose a positive integer $n$ and choose a randomly-generated function $f:\mathbb Z_n \to \mathbb Z_n$. What is the probability that this function corresponds to some polynomial $p \in \mathbb Z_n[x]$?
The question is at least somewhat natural to ask, insofar as if we work over $\mathbb R$, any set of $n$ points can be fit to some polynomial of degree at most $n-1$.
If $n$ happens to be prime, the answer is that the probability is $100 \%$. In more detail: for $n$ prime, any two distinct polynomials of degree $<n$ generate distinct functions, and therefore there are $n^n$ different polynomial functions. Since there are also $n^n$ functions from $\mathbb Z_n$ to itself, every function corresponds to a polynomial.
However, if $n$ is composite, the situation is dramatically different. In general the number of distinct polynomial functions is at most $n^k$, where $k$ is the sum of the prime factors of $n$ (with repetitions). For example if $n=80=2^4 \cdot 5$ then $k=2+2+2+2+5=13$ and there are at most $80^{13}$ different polynomial functions. That means the probability that a randomly-chosen function on $\mathbb Z_{80}$ corresponds to some polynomial is at most $\frac{80^{13}}{80^{80}}=80^{-67} $; that is, the probability is less than $1$ in $3 \times 10^{127}$.
To get a sense of how small that is, it's estimated that the number of atoms in the universe is between $10^{78}$ and $10^{82}$. So the polynomial functions on $\mathbb Z_{80}$ are much, much more scarce than a single atom among the entire universe.
However, if you decrease $n$ from $80$ to $79$ then the probability jumps to $100\%$. Use $n=81$ or $n=82$ and we are back to "rarer than a single atom in the entire universe" territory. But with $n=83$ we're back to $100 \%$.
I think the question is a fascinating one largely because of how dramatically the result depends on whether $n$ is prime or composite, and I am wondering if there are other, similarly dramatic instances of this.
So to be clear: the question I am asking here is not the one above (about polynomials over $\mathbb Z_n$), but rather the follow-up question inspired by it, i.e.
What are some other examples of questions in which the answer depends in rather dramatic form on whether an integer is prime or composite?
(And before anyone else says it: Yes, one obvious example is "What is the probability that $n$ has more than $1$ prime factor?", for which the answer is $0\%$ if $n$ is prime and $100\%$ if $n$ is composite. I'm interested in nontrivial instances of what I hope is a broad phenomenon.)