I've been prodded to ask a question expanding this one on Ramanujan's constant $R=\exp(\pi\sqrt{163})$.

Recall that $R$ is very close to an integer; specifically $R=262537412640768744 - \epsilon$ where $\epsilon$ is about $0.75 \times 10^{-12}$. Call the integer here $N$, so $R = N - \epsilon$.

So $R^2 = N^2 - 2N\epsilon + \epsilon^2$. It turns out that $N\epsilon$ is itself nearly an integer, namely $196884$, and so $R^2$ is again an almost-integer. More precisely,

$$j(\tau) = 1/q + 744 + 196884q + 21493760q^2 + O(q^3)$$

where $q = \exp(2\pi i\tau)$. For $\tau = (1+\sqrt{-163})/2$, and hence $q = \exp(-\pi\sqrt{163})$, it's known that the left-hand side is an integer. Squaring both sides,

$$j(\tau)^2 = 1/q^2 + 1488/q + 974304 + 335950912q + O(q^2).$$

To show that $1/q^2$ is nearly an integer, we can rearrange a bit to get

$$j(\tau)^2 - 1/q^2 - 974304 = 1488/q + 335950912q + O(q^2)$$

and we want the left-hand side to be nearly zero. $1488/q$ is nearly an integer since $1/q$ is nearly an integer; since q is small the higher-order terms on the right-hand side are small.

As noted by Mark Thomas in this question, $R^5$ is also very close to an integer -- but as I pointed out, that integer is not $N^5$. This isn't special to fifth powers. $R$, $R^2$, $R^3$, $R^4$, $R^5$, $R^6$, respectively differ from the nearest integer by less than $10^{-12}$, $10^{-9}$, $10^{-8}$, $10^{-6}$, $10^{-5}$, $10^{-4}$, and $10^{-2}$. But the method of proof outlined above doesn't work for higher powers, since the coefficients of the $q$-expansion of $j(\tau)^5$ (for example) grow too quickly. Is there some explanation for the fact that these higher powers are almost integers?

  • $\begingroup$ I am by no means an expert on this material. I am just easily amused by tricks that people can play with power series, and enough so to want to see an answer to this question. $\endgroup$ Nov 9, 2009 at 21:25
  • $\begingroup$ Writing $R=N-\epsilon$ you can see easily that $R^2$ is not close to $N^2$, so that's why $R^5$ is not close to $N^5$! $\endgroup$ Nov 9, 2009 at 21:52
  • $\begingroup$ Of course. I only specifically singled out the fifth-power case because that's the case that the original question was about. $\endgroup$ Nov 9, 2009 at 22:00
  • $\begingroup$ Typo: q=-exp(-pi.sqrt(163)) in the above (missing minus sign). Fix the typo and then I delete the comment, and no-one ever knew. $\endgroup$ Nov 9, 2009 at 22:01
  • 1
    $\begingroup$ Ben has just written up a lot of the details of the standard proof that the constant is almost an integer. I think one needs to go a little deeper into the theory to answer the question at hand. $\endgroup$ Nov 9, 2009 at 23:42

8 Answers 8


Another take on this:

As David Speyer and FC's answer shows, this question can be answered without any additional deep theory.

However, I'd like to explain a variant on their arguments that puts this in a little more context regarding modular forms. It also means we can use a technique which makes it easier to see how good these approximations are in terms of the growth rate of the coeffients of the j-function.

The important fact here is that any modular function (for SL_2(Z)) with integer coefficients in its q-expansion takes on integer values at τ = (1+√(-163))/2 (and so q = exp(-π√163)). This fact is in fact a consequence of the integrality of the j-value here, since any such function can be expressed as a polynomial in j with integer coefficients (although similar things are true in other contexts, such as modular functions of higher level, where there is not a canonical generator for the ring of such modular invariants).

This means that, just as we can use the integrality of

$j(\tau) = q^{-1} + 744 + O(q) $

to get an integer approximation to $q^{-1}$, if we have a modular function $f_n$ with power series of the form

$f_n(\tau) = q^{-n} + integer + O(q)$,

we can get an integer approximation to $q^{-n}$. How good this approximation is will depend upon the size of the coefficients of the power series for the $O(q)$ part.

Fortunately for us, such a function $f_n$ always exists (and is unique up to adding integer constants). How can we construct it? One way is to take an appropriate polynomial in $j$, that is, take an appropriate linear combination of $j, j^2, \cdots , j^n$ to get a function with the right principal part. This clearly works, and if one works out the details, it should turn out equivalent to FC's and David's approach.

However, now that we're in the modular forms mindset, we have other tools at our disposal. In particular, another way to create new modular functions is to apply Hecke operators to existing modular functions, such as $j$. This turns out to be an effective way to get modular functions of the type we need, since Hecke operators do predictable things to principal parts of q-series (for example, if $p$ is prime, $T_p j = q^{-p} + O(1)$). I'll just explain how this works for $n = 5$, although the method should generalize immediately to any prime $n$ (composite $n$ might be a little trickier, but not much).

The theory of Hecke operators tells us that the function $T_5 j$ defined by

$$(T_5 j)(z) = j(5 z) + \sum_{i \ mod \ 5} j (\frac{z + i}{5})$$

is modular, with q-expansion given by

$$(T_5 j)(\tau) = q^{-5} + \sum_{n = 0}^{\infty} (5 c_{5n} + c_{n/5}) q^n$$.

where the $c_n$ are the coefficients in

$$j(\tau) = q^{-1} + \sum_{n = 0}^{\infty} c_n q^n$$

(and $c_n = 0$ if $n$ is not an integer).

So if as before we set $q = e^{- \pi \sqrt{163}}$, we find that

$q^{-5} + 6 c_0 + 5 c_5 q + 5 c_{10} q^2 + 5 c_{15} q^3 + 5 c_{20} q^4 + (c_1 + 5 c_{25}) q^5 + \dots$

is an integer.

Now, $q$ is roughly $4 \cdot 10^{-18}$, and looking up the coefficients for $j(z)$ on OEIS, we find that

$q^{-5} + 6 \cdot 744 + 5 \cdot (\sim 3\cdot 10^{11}) (\sim 4\cdot10^{-18}) + \text{clearly smaller terms}$

is an integer. Hence $q^{-5}$ should be off from an integer by roughly $6 \cdot 10^{-6}$. This agrees pretty well with what Wolfram Alpha is giving me (it wouldn't be hard to get more digits here, but I'm feeling back-of-the-envelope right now and will call it a night :-)

  • $\begingroup$ Maple claims that the first digits of q^(-5) after the decimal point are .99999365418746897, agreeing with your estimate of 6*10^{-6}. Also, if you enclose TeX code in dollar signs it appears as actual math, which makes notationally intensive answers like this one easier to read. $\endgroup$ Nov 12, 2009 at 16:58
  • 2
    $\begingroup$ This is very nice! $\endgroup$ Nov 12, 2009 at 23:26
  • 1
    $\begingroup$ By the way, some theorems about the (weakly holomorphic) modular forms Alison mentions appear in Ken Ono's book "The Web of Modularity," section 2.3. The analogous families of modular forms in weight 1/2 and 3/2 are relevant to Borcherds products -- see sectons 4.2 and 4.3 in Ken's book. $\endgroup$
    – JSE
    Nov 17, 2009 at 22:18

I'm not sure I agree with buzzard that some secret class field theory is going on. (There is some not so secret class field theory, of course.) I think this phenomenon is purely a feature of the fact that the coefficients of j do not grow so quickly (i.e. are sub-exponential). For example, for R^3, one can write:

$$j^3 - 2232 \cdot j^2 + 1056786 \cdot j - 27068496 = \frac{1}{q^3} - \frac{13170}{q} - 62370 \cdot q + \ldots$$

The O(q) terms are miniscule, and this expression shows that what is being called R^3 above is very close to an integer. And one can randomly write down the expression:

$$j^4 - 2976 \cdot j^3 + 2533439 \cdot j^2 - 561444705 \cdot j + 8735797224$$ $$ = \frac{1}{q^4} - \frac{241}{q^2} - \frac{358705}{q} + 157484 \cdot q + \ldots$$

For which one also sees that R^4 is close to an integer (the error term one gets from this expression is not quite as accurate as the first, but it is still good.) I will cryptically say that as n gets bigger the trick to write down the expression giving the "best" is to perform an LLL algorithm, which gets harder to do by staring at mathematica output as n gets bigger. Indeed, I'm sure someone who actually knows how to implement LLL could do much better for n = 4. Clearly nothing modular is going on here.

For those who need more convincing that this has nothing to do with anything mysterious, suppose that

$$j = \frac{1}{q} + 1066 + 144169 \cdot q + 16174955132 \cdot q^2 + \sum_{n=3}^{\infty} c(n) q^n $$

Here c(n) denotes the usual coefficients of j, 1066 was the date of the battle of Hastings, 144169 is both a concatenation of two squares and a prime that has something to do with modular forms of weight 24 and level 1, and 16174955132 is the fax number to the Harvard mathematics department. Let R = q^-1 be the solution to the equation j = -(640320)^3 which is approximately 10^18. Then R, R^2, R^3, R^4, R^5, R^6 are to within (approximately) 10^(-12), 10^(-7), 10^(-8), 10^(-6), 10^(-5), 10^(-4) of integers. Note that this is pretty much as good as what happened in the classical case.

Now there are some interesting facts related to approximations of integers by numbers of this form, it's just that this isn't one of them. (Fun and interesting exercise requiring something "slightly deeper in the theory" as buzzard might say: explain why $exp(\pi \sqrt{58})$ is close to an integer.)

  • 1
    $\begingroup$ I think that what you're saying FC is that rather than just raising the q-expansion of j to the 5th power and then noting that the bounds aren't good enough and giving up, we should be writing down some more careful 5th degree poly in j, which would be good enough. And the fact that you didn't do this is some sort of indication that the correct poly is a little tricky to find? $\endgroup$ Nov 10, 2009 at 8:58
  • 1
    $\begingroup$ So pari can do LLL. Using it I get $126476476039j-1503930055j^2+3945885j^3-3519j^4+j^5=q^{-5} + 201q^{-4} - 6879q^{-3} - 2463q^{-2} - 6323q^{-1} - 13080 - 7358q + 347786775737915540q^2 + O(q^3)$ where the coefficients in $q^n$, $n\geq3$ aren't growing as fast as $10^{17n}$. This shows that if $R^n$ is close to an integer for $n=1,2,3,4$ then it's also close for $n=5$. $\endgroup$ Nov 10, 2009 at 9:20

There is an obvious computation here that no one seems to be doing. Invert the power series for $j$, to write

$$q^{-1} = j + a(0) + a(1) j^{-1} + a(2) j^{-2} + \cdots.$$

(Notice that the $a(i)$ will be integers.)

Raise this to the, for example, $5$th power to get

$$q^{-5} = j^5 + b(-4) j^4 + \cdots + b(0) + b(1) j^{-1} + \cdots.$$

See whether the coefficients $b$ are dropping off fast enough to give a simple explanation. People are assuming that the fact that the coefficients for $j$ in terms of $q$ grow rapidly means that the coefficients for the inverse will grow rapidly too, but that doesn't seem justified to me.

UPDATE: Ok, here is some data.

$$q^{-1} = j - 744 - 196884/j + \cdots = \mathbb{Z} - 7.5 \times 10^{-13} + \cdots $$ $$q^{-2} = j^2 - 1488 j + 159768 - 42987520 / j + \cdots = \mathbb{Z} - 1.6 \times 10^{-10}$$

From here, it get's too long to write out the details, so I'll just give the first noninteger term:

$$q^{-3} = \mathbb{Z} -9.88 \times 10^{-9} + \cdots $$ $$q^{-4} = \mathbb{Z} -3.08 \times 10^{-7} + \cdots $$ $$q^{-5} = \mathbb{Z}-6.35 \times 10^{-6} + \cdots $$ $$q^{-6} = \mathbb{Z}-9.72 \times 10^{-5} + \cdots $$ $$q^{-7} = \mathbb{Z}-1.19 \times 10^{-3} + \cdots $$ $$q^{-8} = \mathbb{Z}-1.22 \times 10^{-2} + \cdots $$ $$q^{-9} = \mathbb{Z}-0.109 + \cdots $$ $$q^{-10} = \mathbb{Z}-0.860 + \cdots $$

Juding from Michael's data above, the later terms also make substantial contributions, but I think this explains a large part of the mystery.

And, in case it is useful to anyone, here is the first 14 coefficients of $q^{-1}$ as a power series in $j^{-1}$.

{1, -744, -196884, -167975456, -180592706130, -217940004309744, -282054965806724344, -382591095354251539392, -536797252082856840544683, -772598111838972001258770120, -1134346327935015067651297762308, -1692324738742597705005194275401888}

Notice that the series starts $q^{-1} = j - 744 -196884/j + \cdots$.

  • $\begingroup$ They do grow rapidly, but looking at the first few terms on a computer I think that this method works fine, giving bounds with the correct order of magnitude, and is better than any other mentioned so far. $\endgroup$ Nov 10, 2009 at 14:44

Churchhouse, Muir's "Continued Fractions, Algebraic Numbers and Modular Invariants" is nice to read.


There is a paper online about this here:


  • 1
    $\begingroup$ As noted already, Ben is just writing up the standard proof that the constant is almost an integer. The question here is whether the standard proof can be massaged to give the stronger results noted in the q or whether one has to use deeper stuff. $\endgroup$ Nov 10, 2009 at 7:41

According to one of my references, Chapter 11 of this book by David Cox is supposed to have a full explanation of the question you ask.

  • $\begingroup$ Thanks for the pointer. I went to the library and checked out this book. The explanation you refer to doesn't jump out at me but I suspect it's there in a non-obvious way. $\endgroup$ Nov 9, 2009 at 22:30
  • $\begingroup$ This book has only 8 chapters. $\endgroup$ Dec 10, 2016 at 10:44

I'm a bit confused. Sage tells me that R^10 isn't particularly close to an integer. Am I missing the point here?

  • $\begingroup$ I agree. Maple tells me R^10 is not that close to an integer. Try smaller powers. $\endgroup$ Nov 10, 2009 at 2:21
  • $\begingroup$ Yes - I tried everything up to 12. R^n seems to drift away from being an integer. $\endgroup$
    – Sam Nead
    Nov 10, 2009 at 2:26
  • $\begingroup$ Ah, perhaps I see - even for R^2 to be close to an integer is surprising. $\endgroup$
    – Sam Nead
    Nov 10, 2009 at 2:32
  • $\begingroup$ Right. Because $R$ differs from an integer by much less than $1/R$, it's already surprising that $R^2$ is close to an integer. The reason for this is that $N\epsilon$ is also close to an integer. But this logic doesn't seem to generalise well enough to get to $R^5$. $\endgroup$ Nov 10, 2009 at 7:43

I think the right approach would be to observe that $R^n$ is the leading term in $j(n\tau)$ as above. Then there is a modular polynomial $\Phi_n$ which satisfies $\Phi_n(j(x),j(nx))=0$. For small $n$ you could presumably just solve this for $j(n\tau)$ in terms of $j(\tau)$, especially since modular curves are rational for small n. The conclusion would be that $j(n\tau)$ is, again for small $n$, an integer.

  • 1
    $\begingroup$ I think that the conclusion from this would in fact be that j(n.tau) satisfied a polynomial of low degree but with humungous coefficients. Computer calculation indicate that j(5.tau) is in fact not an integer for tau as above, although it is close to one. $\endgroup$ Nov 9, 2009 at 22:27
  • 1
    $\begingroup$ I don't think $j(n \tau)$ should be an integer. I think that would indicate that the order $Z[n \tau]$ has trivial class group, and I'm pretty sure that's not true. But I'm rusty on how the elliptic curve/class field dictionary works for nonmaximal orders. $\endgroup$ Nov 9, 2009 at 22:30
  • $\begingroup$ I tried this on a computer. The conclusion is that j(5*tau) is a root of an irreducible degree 6 polynomial with coefficient of the order of 10^{100}. $\endgroup$ Nov 9, 2009 at 23:51
  • $\begingroup$ In fact the root we want is the one which is about -10^{87} and within 10^{-6} of an integer. The other roots are "random" complex numbers (not near integers, or even near the reals in general) of size about 10^5. $\endgroup$ Nov 9, 2009 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.