Can any function on naturals be interpolated to a smooth function on reals? Let $f : \mathbb{N} \rightarrow \mathbb{N}$ be an arbitrary function from naturals to naturals. Is it always possible to find a function $g : \mathbb{R} \rightarrow \mathbb{R}$ such that

*

*for any $n \in \mathbb{N}$, we have $f(n) = g(n)$, and

*$g \in C^\infty$?

I'm asking because I was trying to prove a result about the ratios of functions from naturals to naturals and it occurred to me that if I could always interpolate to get back smooth functions from integers to integers, I could conceivably use l'Hopital's rule to resolve the limits.
Thanks!

First, one needs an analytic function such that $f(0)=1$ and $f(n)=n$ for $n\in\mathbb Z  \setminus\{0\}$. The sinc function can be useful for that:
$$\operatorname{sinc}x  = \frac{\sin x}x, ~~ x\in \mathbb R\setminus\{0\}$$
$$\operatorname{sinc}0  = \lim_{x\to 0}\frac{\sin x}x = 1$$
Note that $\operatorname{sinc}0=1$and $\mathrm{sinc} (n\pi) = 0$ for $n\in\mathbb Z  \setminus\{0\}$, as needed. Therefore, one could construct
$$
g(x) = \sum_{n\in\mathbb N} \operatorname{sinc}[(n-x)\pi] f(n)
$$
and have $g(n) = f(n)$ for all $n \in \mathbb N$.
However, this would not in general even converge for any choice $f(n)$, and even if it converges, it might not have all the derivatives (i.e. the derivatives might not converge). In order to fix this, the function used to construct $g(x)$ should be modified to fall sufficiently fast. Just replacing this function with a different one which would be the same for every $n$ can work for a wider class of functions $f(n)$, but it will not work in general, regardless of the choice. The modification should depend on individual values $f(n)$. Something like this:
$$
g(x) = \sum_{n\in\mathbb N} \operatorname{sinc}[(n-x)\pi] e^{-f(n)^2(n-x)^2} f(n)
$$
That way, no matter how absurdly fast $f(n)$ grows (e.g. something that needs to be written using Knuth's up-arrow notation or Conway chained arrow notation or worse, like the TREE function), $g(x)$ will converge everywhere and it will even be in $C^\omega$.
