I am looking for examples of formulas $f: \mathbf{N} \rightarrow \mathbf{N}$ for which the number of conjectured primes $p \in \text{ Im}(f)$ is either finite or less than what naive heuristics would suggest.
Let $\pi_{f(n)}(N)$ denote the number of naturals $n \leq N$ such that $f(n)$ is prime.
For example, consider $f(n) = n^2 + 1$. It is conjectured that $\pi_{f(n)}(N) \sim \frac{N}{\log(N^2+1)} \sim \frac{N}{2\log(N)}$. This naive heuristic (which is based on the Prime Number Theorem) seems to agree with numerical testing. In other words, the distribution of primes in $\text{ Im}(f)$ seems to be "similar" to the distribution of primes in $\mathbf{N}$, with not too many additional divisibility constraints.
However, if we instead take $f(n) = 2^{2^n} + 1$, it is conjectured that $f(4)$ is the last such prime. In fact, $f(1), f(2), f(3)$, and $f(4)$ are believed to be the only primes of this form. Heuristics about primes in general likely fail in this case, suggesting that there are significant additional divisibility constraints. I am looking for more examples like this one.
For more careful heuristics about these primes, see Conway and Boklan's paper: https://arxiv.org/pdf/1605.01371.pdf.
Correction: Of course, if there is an obvious reason why a formula is prime for finitely many values of $n$ like $f(n) = n^2 - 1 = (n-1)(n+1)$, then I don't really care about it.