TITLE: $e^{\pi\sqrt N}$ is very close to an integer for some smallish $N$s. What about $\pi^{e\sqrt N}$?
QUESTION [11 upvotes]: Heegner numbers (1, 2, 3, 7, 11, 19, 43, 67, 163 - let's use symbol $H_n$) are know for peculiar property that $e^{\pi\sqrt{H_n}}$ are almost integers:
$$e^{\pi \sqrt{19}}  \approx 96^3+744-0.22$$
$$e^{\pi \sqrt{43}}  \approx 960^3+744-0.00022$$
$$e^{\pi \sqrt{67}}  \approx 5280^3+744-0.0000013$$
$$e^{\pi \sqrt{163}} \approx 640320^3+744-0.00000000000075$$
(given that they are all less than 200, it goes far beyond "chance" and "randomness")
Even stranger, related to the above:
$$19 = 3 \cdot 2 \cdot 3+1$$
$$43 = 7 \cdot 2 \cdot 3+1$$
$$67 = 11 \cdot 2 \cdot 3+1$$
$$163 = 27 \cdot 2 \cdot 3+1$$
and
$$96^3 =(2^5 \cdot 3)^3$$
$$960^3=(2^6 \cdot 3 \cdot 5)^3$$
$$5280^3=(2^5 \cdot 3 \cdot 5 \cdot 11)^3$$
$$640320^3=(2^6 \cdot 3 \cdot 5 \cdot 23 \cdot 29)^3$$

Related to this, I would like to know:
Are there natural numbers N (of fairly similar range, so, lets say under 500) that produce "almost" integers in the expression $\pi^{e\sqrt{N}}$?
If yes, do they have other interesting properties, like Heegner numbers do?
If not, all right, one more reason to appreciate Heegners. :)

REPLY [10 votes]: The phenomenon with the Heegner numbers can be generalized to,
$$e^{\pi\sqrt{-d}/a}\tag1$$
with discriminants $d=b^2-4ac$, of the quadratic,
$$P(n) = an^2+bn+c\tag2$$
These $d$ have very interesting properties.
I. Connection to prime-generating polynomials:
I'm sure you are familiar with Euler's,
$$P(n) =n^2+n+41\tag3$$
However, there are other optimum prime-generating polynomials with $a\neq1$,
$$P(n) =2n^2+29\tag4$$
$$P(n) =2n^2+2n+19\tag5$$
$$P(n) =3n^2+3n+23\tag6$$
$$P(n) =4n^2+163\tag7$$
$$P(n) =6n^2+6n+31\tag8$$
and others. Using the values of their $a,d$ into $(1)$, one gets,
$$\begin{aligned}
&e^{\pi\sqrt{163}/1} = 640320^3 +743.999999\dots\\
&e^{\pi\sqrt{232}/2} = e^{\pi\sqrt{58}} = 396^4 -104.0000001\dots\\ 
&e^{\pi\sqrt{148}/2} = e^{\pi\sqrt{37}} = (84\sqrt{2})^4 +103.99997\dots\\
&e^{\pi\sqrt{267}/3} = 300^3 + 41.99997\dots\\
&e^{\pi\sqrt{10432}/4} = e^{\pi\sqrt{4\cdot163}} = (640320^3+744)^2 - 2\cdot \color{blue}{196883}.99999\dots\\
&e^{\pi\sqrt{708}/6} = 1060^2 + 9.99992\dots
\end{aligned}$$
and so on.

What's 196884? (OEIS)
And here why $\log(196883) \approx 4\pi$ is important to quantum gravity. (Huh?)

More on these prime-generating polynomials here.
II. Connection to pi formulas:
In addition, each one of these integer approximations can be used in a Ramanujan-Sato pi formula. The most famous of course, is with $d = 4\cdot58$,
$$\frac{1}{\pi} = \frac{2 \sqrt 2}{99^2} \sum_{k=0}^\infty \frac{(4k)!}{k!^4} \frac{58\cdot455k+1103}{396^{4k}}$$
III. Connection to Pell equations:
Furthermore, they are also connected to Pell equations. For example, the fundamental solution to,
$$x^2-3\cdot163y^2 = 1$$
$$x,\;y = 7592629975,\;343350596$$
hence the fundamental unit,
$$U =x+y\sqrt{489} =7592629975+343350596\sqrt{489} = \big(35573\sqrt{3}+4826\sqrt{163}\big)^2$$
Then,
$$\Big(3\sqrt{3}\big(U^{1/2}-U^{-1/2}\big)+6\Big)^3 = 640320^3$$
You can read more in this MO post. There is a lot more to $e^{\pi\sqrt{n}}$ than being near-integers, it seems.