I have found the problem with the following formulation.
Represent the following function as a primitive recursive:
$f(n) = [ne]$
where $n$ is the natural number, $e$ - Euler's number, $[ne]$ is the integer part of $ne$.
Unfortunately, I do not have more clarification or the reference solution.
As I see, there may be two cases here described below.
Case 1 seems to be clear and probably doesn't need a discussion.
I'm actually interested in Case 2. Could you please provide your thoughts or comments on it.
Case 1
It is enough to have integer precision, i.e.
$ne - f(n) < 1$
The general approach for this case can be the following.
We can represent $ne$ as the series:
$$ne = n\sum_{m=0}^\infty \frac{1}{m!}$$
The k-th remainder for this series can be estimated using Lagrange's form:
$$R_k < \frac{3n}{(k+1)!}$$
So to calculate $f(n)$ we just need to sum $k$ components of the series where $k$ is :
$$min\{\frac{3n}{(k+1)!} < 1\}$$
and then take the integer part of the result.
As I understand, the representation as a primitive recursive shouldn't cause problems in this case,
since for each $n$ we can point, before starting summation, the exact number of components
we need to sum to get the result.
The disadvantage is that we cannot guarantee that $f(n)$ will always be exactly the integer part of $ne$.
Just as an example, if:
$ne = 10.1232434...$
and we calculate the series until we get $9.9999999$ and then take the integer part, then we get $f(n) = 9$
which is not exactly the integer part of $10.1232434...$.
As I understand, even if we increase precision to $0.1$, $0.01$ and etc, the cases like above can still happen.
Case 2
$f(n)$ should be exactly the integer part of $ne$.
For this case I don't know even the general approach.
If we use the representation for $ne$ like in Case 1:
$$ne = n\sum_{m=0}^\infty \frac{1}{m!}$$
then for each $n$ we need to point, before starting summation, the exact number of components
of the series we need to sum to get exactly the integer part of $ne$ in the result.
The approach for identification of this number of components is unclear.
As I mentioned, I do not have more clarification for this task, so maybe there is no solution for Case 2 at all.
$ne$ can be represented as the series:
$$ne = n\sum_{m=0}^\infty \frac{1}{m!}$$
We need to estimate how many components of this series we need to sum to get its integer part.
Assume we summed $k$ components. In this case the series can be represented as:
$$ne = S_k + R_k,$$
$$S_k = n\sum_{m=0}^k \frac{1}{m!} - \text{sum of } k \text{ components},$$
$$R_k = n\sum_{m=k+1}^\infty \frac{1}{m!} - \text{remainder of the series}.$$
Let's consider $S_k$:
$$S_k = n\sum_{m=0}^k \frac{1}{m!} = n\Big(2 + \frac{1}{2!} + \frac{1}{3!} + ... +\frac{1}{(k-1)!} + \frac{1}{k!}\Big)=\\= \frac{n\Big(2k! + k(k-1)...3 + k(k-1)...4 + k + 1\Big)}{k!}=N + \frac{p}{k!},$$
where:
$N \in \mathbb{N}$ is the integer part of $S_k$;
$\frac{p}{k!} < 1$ is the fractional part of $S_k$, $p \in \mathbb{N}$
We can now represent $ne$ as:
$$ne = S_k + R_k = N + \frac{p}{k!} + R_k$$
We would like to choose $k$ in a way so that $N$ would represent the integer part of the whole series.
In this case we need to guarantee:
$$\frac{p}{k!} + R_k < 1.$$
In order to achieve this, it is enough to have:
$$R_k < \frac{1}{k!}.$$
After applying Lagrange's estimation to $R_k$, we have:
$$R_k = n\sum_{m=k+1}^\infty \frac{1}{m!} < \frac{3n}{(k+1)!} < \frac{1}{k!} $$
$$\frac{3n}{(k+1)!} < \frac{1}{k!}$$
$$3n < k + 1$$
$$k \geqslant 3n.$$
So if we sum $k = 3n$ components of the series and then take the integer part of it, then this value will be the integer part of the whole series.
As the number of components to sum is known before the start of summation, and as all operations involved in the process are basic arithmetic operations, known to be primitive recursive, then the whole procedure can also be considered as a primitive recursive.