What functions from $\Bbb N\to\Bbb N$ can be made from $+$, $-$, $\times$, $\div$, exponentiation, and $\lfloor\cdot\rfloor$? Call this class of functions $\mathcal Flex$ (for "floor and exponentiation").
The $\rm mod$ function $a\operatorname{mod}b$ can be defined by $a-b\lfloor a/b\rfloor$. In addition, $$\binom nk=\left\lfloor\frac{(u+1)^n}{u^k}\right\rfloor\operatorname{mod}u$$ for $u>2^n$, and $$n!=\left\lfloor\frac{r^n}{\binom rn}\right\rfloor$$ for $r>(2n)^{n+1}$. Thus the factorial function is in $\mathcal Flex$.
The function $\left\lfloor\lfloor\frac ab\rfloor-\frac ab\right\rfloor+1$ equals $1$ if $a$ divides $b$ and $0$ otherwise. According to Wilson's theorem, $n$ is prime iff $n$ divides $(n-1)!+1$; therefore, the function that is $1$ for primes and $0$ otherwise is in $\mathcal Flex$.
The function $\delta_{0,n}$ is in $\mathcal Flex$ since it equals $\left\lfloor\frac1{1+n}\right\rfloor$. I feel like there should be some way to use the MDRP theorem to show that all primitive recursive functions with images in $\{0,1\}$ are in $\mathcal Flex$, but I'm not quite sure how.
In fact, my big conjecture so far is that $\mathcal Flex$ actually equals the set of all primitive-recursive functions. (And I have a suspicion that exponentiation might be unnecessary after all...)
*Unless pi has an incredibly long string of zeros somewhere in its decimal expansion.
– RavenclawPrefect Jan 23 '24 at 12:39