# Examples of transcendental functions giving almost integers

Informally speaking, an “almost integer” is a real number very close to an integer.

There are some known ways to construct such examples in a systematic way. One is through the use of certain algebraic numbers called Pisot numbers. These numbers $$α\alpha$$ have the property that their powers can get arbitrarly close to integers, that is:

$$limn→∞α−[αn]=0\lim_{n \to \infty} \alpha - [\alpha^n] = 0$$

where $$[.][ .]$$ is the nearest integer function.

A well-known example is given by the golden ratio $$φ=1+√52\varphi = \frac{1 + \sqrt{5}}{2}$$, whose powers are increasingly close to integers:

$$φ19=9349.000107…\varphi^{19} = 9349.000107...$$

$$φ25=167761.00000596…\varphi^{25} = 167761.00000596...$$

Another example comes from numbers of the form $$eπ√ne^{\pi\sqrt{n}}$$.

A well-known example is Ramanujan’s constant:

$$eπ√163=262537412640768743.99999999999925007…e^{\pi\sqrt{163}} = 262537412640768743.99999999999925007...$$

There’s another interesting way to generate almost integers by using the numbers $$ee$$ and $$π\pi$$. By using the identity

$$∞∑n=−∞e−πn2x=x−1/2∞∑n=−∞e−πn2/x.\sum_{n=-\infty}^\infty e^{-\pi n^2x}=x^{-1/2}\sum_{n=-\infty}^\infty e^{-\pi n^2/x}.$$

we can derive the approximate identity

$$(∗)n−1∑k=0e−k2πn≈1+√n2 (*) \sum_{k=0}^{n-1}{e^{-\frac{k^2\pi}{n}}}\approx\frac{1+\sqrt{n}}{2}$$

which provides a way to construct almost integers with increasing precision:

$$e−π9+e−4π9+e−9π9+e−16π9+e−25π9+e−36π9+e−49π9+e−64π9=1.0000000000010504… e^{-\frac{\pi}{9}} + e^{-4\frac{\pi}{9}} + e^{-9\frac{\pi}{9}} + e^{-16\frac{\pi}{9}} + e^{-25\frac{\pi}{9}} + e^{-36\frac{\pi}{9}} + e^{-49\frac{\pi}{9}} + e^{-64\frac{\pi}{9}} = 1.0000000000010504...$$

$$∑24k=1e−k2π25=2.000000000000000000000000000000000310793…\sum_{k=1}^{24} e^{-k^2\frac{\pi}{25}} = 2.000000000000000000000000000000000310793...$$

$$∑48k=1e−k2π49=3.000000000000000000000000000000000000000000000000000000000000000000838654…\sum_{k=1}^{48} e^{-k^2\frac{\pi}{49}} = 3.000000000000000000000000000000000000000000000000000000000000000000838654...$$

So, the question is: is there another way to generate almost integers -with or without increasing precision- by using transcendental functions, as in the previous example?

(Note that there’s a trivial way to do this: By taking a convergent series $$∑∞k=1xk\sum_{k = 1 }^\infty x_k$$ and its limit $$LL$$, the number $$1/L∑nk=1xk1/L\sum_{k = 1 }^n x_k$$ will be an almost integer, namely close to $$11$$, but I’m looking for a an example like identity (*), or for a different, non trivial one). So, I am looking for an example that may be of the form $$∑nk=1f(xk)\sum_{k = 1 }^n f(x_k)$$, where $$f(x)f(x)$$ is a transcendental function of $$xx$$, that is able to generate a set of different almost integers (zero excluded).

1) If $$a,b∈Ra,b\in\textbf{R}$$ and $$a, then if $$f(x)f(x)$$ is continuous:
$$b−aNN∑n=0f(a+b−aNn)=∫baf(t)dt+o(1), N→∞. \frac{b-a}{N}\sum^{N}_{n=0}f\left(a+\frac{b-a}{N}n\right)=\int^{b}_{a}f(t)dt+o(1)\textrm{, }N\rightarrow\infty.$$
2) If $$[x]\left[x\right]$$ denotes largest integer $$≤x\leq x$$ and $$aa$$ is a non-rational real number, then
$$limn→∞[na]n=a \lim_{n\rightarrow\infty}\frac{\left[na\right]}{n}=a$$
i.e. every real number can be approximated by rational numbers arbitrarily well.

3) If $$β1=1/2\beta_{1}=1/2$$,
$$βr+1=1−√1−βr/22, \beta_{r+1}=\frac{1-\sqrt{1-\beta_{r/2}}}{2},$$
then
$$sin(π2(r+1))=√βr \sin\left(\frac{\pi}{2(r+1)}\right)=\sqrt{\beta_r}$$
4) This one is quite involved.
$$e−25π=13−16√4+75π−12log2+6logk−6.2619875...×10−103, e^{-25\pi}=\frac{1}{3}-\frac{1}{6}\sqrt{4+75\pi-12\log 2+6\log k}-6.2619875...\times 10^{-103},$$
where
$$k=\sqrt{\frac{1}{2}-\frac{1}{2}\sqrt{1-(51841-23184\sqrt{5})Y^{12}}}, k=\sqrt{\frac{1}{2}-\frac{1}{2}\sqrt{1-(51841-23184\sqrt{5})Y^{12}}},$$
where $$YY$$ is a root of
$$Y^3+5s^{-1}Y^2-sY-1=0, Y^3+5s^{-1}Y^2-sY-1=0,$$
where $$ss$$ is such
$$s=\sqrt[3]{\frac{(t-1)^5}{11+6t+6t^2+t^3+t^4}}, s=\sqrt[3]{\frac{(t-1)^5}{11+6t+6t^2+t^3+t^4}},$$
where
$$t=2\sinh\left(\frac{1}{4}\textrm{arcsinh}\left(\frac{9+\sqrt{5}}{2}\right)\right). t=2\sinh\left(\frac{1}{4}\textrm{arcsinh}\left(\frac{9+\sqrt{5}}{2}\right)\right).$$
Note that $$tt$$ is an algebraic number.

5) Set
$$p=\sqrt{2+216\cdot 5^{1/4}-96\cdot 5^{3/4}} p=\sqrt{2+216\cdot 5^{1/4}-96\cdot 5^{3/4}}$$
and
$$k=1-\frac{2}{1+t}\textrm{, }t=\frac{\left(\sqrt{2}+\sqrt{p}\right)^2}{2\cdot 2^{3/4}p^{1/4}\sqrt{2+p}}. k=1-\frac{2}{1+t}\textrm{, }t=\frac{\left(\sqrt{2}+\sqrt{p}\right)^2}{2\cdot 2^{3/4}p^{1/4}\sqrt{2+p}}.$$
Also
$$l=\left(1+\frac{2^{3/4}p^{1/4}}{\sqrt{2+p}}\right)^2\frac{4+2\sqrt{5}+\sqrt{2}(3+2\cdot 5^{1/4})}{160}. l=\left(1+\frac{2^{3/4}p^{1/4}}{\sqrt{2+p}}\right)^2\frac{4+2\sqrt{5}+\sqrt{2}(3+2\cdot 5^{1/4})}{160}.$$
Then
$$\frac{\Gamma\left(\frac{1}{4}\right)^2}{\pi^{3/2}}=\frac{4+k^2-6k^4}{4l}-7.01743379...\times 10^{-107}. \frac{\Gamma\left(\frac{1}{4}\right)^2}{\pi^{3/2}}=\frac{4+k^2-6k^4}{4l}-7.01743379...\times 10^{-107}.$$
6) (Ramanujan) For $$|x|<1|x|<1$$,
$$\prod_{k=1}^{\infty}\left(1-x^{p_k}\right)^{-1}=1+\sum^{\infty}_{k=1}\frac{x^{p_1+p_2+\ldots+p_k}}{(1-x)(1-x^2)\ldots(1-x^k)},\tag 1 \prod_{k=1}^{\infty}\left(1-x^{p_k}\right)^{-1}=1+\sum^{\infty}_{k=1}\frac{x^{p_1+p_2+\ldots+p_k}}{(1-x)(1-x^2)\ldots(1-x^k)},\tag 1$$
where $$p_1,p_2,\ldots,p_1,p_2,\ldots,$$ denote the primes in ascending order. The above formula $$(1)(1)$$ is canceled i.e. the Taylor series on both sides of $$(1)(1)$$ agree only to the first 22 terms.
(see Bruce C. Berndt. "Ramanujan's Notebooks I." Springer-Verlag, New York Inc. (1985) page 130).

7) This one is inspired from a formula of Ramanujan

Let $$a,ba,b$$ be positive reals with $$ab=2\piab=2\pi$$ and $$\Psi(x)\Psi(x)$$ analytic on $$\textbf{R}\textbf{R}$$. Let also
$$M\Psi(s)=\int^{\infty}_{0}\Psi(x)x^{s-1}dx, M\Psi(s)=\int^{\infty}_{0}\Psi(x)x^{s-1}dx,$$
be the Mellin transform of $$\Psi\Psi$$. If also
$$\phi(x)=Re\left(M\Psi(ix)n^{-ix}\right). \phi(x)=Re\left(M\Psi(ix)n^{-ix}\right).$$
Then
$$a\sum^{\infty}_{k=0}\Psi\left(ne^{ak}\right)=a\left(1/2-\sum^{\infty}_{k=1}\frac{\Psi^{(k)}(0)}{k!}\frac{n^k}{e^{ak}-1}\right)+c+2\sum^{\infty}_{k=1}\phi(bk),\tag 2 a\sum^{\infty}_{k=0}\Psi\left(ne^{ak}\right)=a\left(1/2-\sum^{\infty}_{k=1}\frac{\Psi^{(k)}(0)}{k!}\frac{n^k}{e^{ak}-1}\right)+c+2\sum^{\infty}_{k=1}\phi(bk),\tag 2$$
where $$c=\lim_{h\rightarrow 0}\phi(h)=:\phi(0)c=\lim_{h\rightarrow 0}\phi(h)=:\phi(0)$$.

Example

For $$\Psi(x)=e^{-x}\Psi(x)=e^{-x}$$, we get
$$a\sum^{\infty}_{k=0}e^{-ne^{ak}}=a\left(1/2-\sum^{\infty}_{k=1}\frac{(-1)^kn^k}{k!(e^{ak}-1)}\right)-\gamma-\log n+2\sum^{\infty}_{k=1}\phi(bk),\tag 3 a\sum^{\infty}_{k=0}e^{-ne^{ak}}=a\left(1/2-\sum^{\infty}_{k=1}\frac{(-1)^kn^k}{k!(e^{ak}-1)}\right)-\gamma-\log n+2\sum^{\infty}_{k=1}\phi(bk),\tag 3$$
where $$\phi(x)=Re\left(\Gamma(ix)n^{-ix}\right)\phi(x)=Re\left(\Gamma(ix)n^{-ix}\right)$$ and $$c=\phi(0)=-\gamma-\log nc=\phi(0)=-\gamma-\log n$$.

For $$n=1n=1$$ in (3), we get the formula of Ramanujan and a good approximation of $$\gamma\gamma$$ constant (Euler's constant).

If $$a=1/Na=1/N$$ then $$b=2\pi Nb=2\pi N$$ and we get as $$N\rightarrow\inftyN\rightarrow\infty$$
$$\gamma=-\frac{1}{N}\sum^{\infty}_{k=0}\exp\left(-e^{k/N}\right)+\frac{1}{N}\left(\frac{1}{2}-\sum^{\infty}_{k=1}\frac{(-1)^k}{k!\left(e^{k/N}-1\right)}\right)+O\left(e^{-\pi^2N}\right)\tag 4 \gamma=-\frac{1}{N}\sum^{\infty}_{k=0}\exp\left(-e^{k/N}\right)+\frac{1}{N}\left(\frac{1}{2}-\sum^{\infty}_{k=1}\frac{(-1)^k}{k!\left(e^{k/N}-1\right)}\right)+O\left(e^{-\pi^2N}\right)\tag 4$$
Also for $$a=\frac{\log A}{N}a=\frac{\log A}{N}$$, then $$b=\frac{2\pi N}{\log A}b=\frac{2\pi N}{\log A}$$ and holds
$$\gamma=-\frac{\log A}{N}\sum^{\infty}_{k=0}\exp\left(-A^{k/N}\right)+\frac{\log A}{N}\left(\frac{1}{2}-\sum^{\infty}_{k=1}\frac{(-1)^k}{k!(A^{k/N}-1)}\right)+O\left(e^{-\pi^2N/\log A}\right).\tag 5 \gamma=-\frac{\log A}{N}\sum^{\infty}_{k=0}\exp\left(-A^{k/N}\right)+\frac{\log A}{N}\left(\frac{1}{2}-\sum^{\infty}_{k=1}\frac{(-1)^k}{k!(A^{k/N}-1)}\right)+O\left(e^{-\pi^2N/\log A}\right).\tag 5$$
Set now
$$k_{10}(N)=\left[\frac{N}{\log A}\log\left(\frac{N\pi^2}{\log A}\right)\right]+1 k_{10}(N)=\left[\frac{N}{\log A}\log\left(\frac{N\pi^2}{\log A}\right)\right]+1$$
and
$$k_{20}(N)=\left[\frac{N\pi^2}{C_N\log A}\right]+1\textrm{, }C_N=P_L\left(\frac{A^{1/N}N\pi^2}{e\log A}\right), k_{20}(N)=\left[\frac{N\pi^2}{C_N\log A}\right]+1\textrm{, }C_N=P_L\left(\frac{A^{1/N}N\pi^2}{e\log A}\right),$$
where $$P_L(x)P_L(x)$$ is the product log function i.e. $$e^{P_L(x)}P_L(x)=xe^{P_L(x)}P_L(x)=x$$. Then
$$\frac{\gamma}{\log A}=-\frac{1}{N}\sum^{k_{10}(N)}_{k=0}\exp\left(-A^{k/N}\right)+\frac{1}{N}\left(\frac{1}{2}-\sum^{k_{20}(N)}_{k=1}\frac{(-1)^k}{k!(A^{k/N}-1)}\right)+O\left(e^{-\pi^2N/\log A}\right).\tag 6 \frac{\gamma}{\log A}=-\frac{1}{N}\sum^{k_{10}(N)}_{k=0}\exp\left(-A^{k/N}\right)+\frac{1}{N}\left(\frac{1}{2}-\sum^{k_{20}(N)}_{k=1}\frac{(-1)^k}{k!(A^{k/N}-1)}\right)+O\left(e^{-\pi^2N/\log A}\right).\tag 6$$

8)
$$\left(e^{\pi\sqrt{163}}-744\right)^{1/3}=640319.99999999999999999999999939031735...\left(e^{\pi\sqrt{163}}-744\right)^{1/3}=640319.99999999999999999999999939031735...$$