# Ramanujan numbers

$$\def\sp{\;\;\;\;} \def\Ree{\text{Re}} \def\qed{\square} \def\S{} \def\fix[#1,#2,#3,#4][#5,#6,#7,#8][#9]{ #1 & #2 & #3 & #4 & #5 & #6 & #7 & #8 & #9\\ } \def\fiy[#1,#2,#3,#4][#5,#6,#7,#8]{ #1 & #2 & #3 & #4 & #5 & #6 & #7 & #8 \\ }$$

# Ramanujan Numbers

## John Butcher

1. Introduction The aim of this miniature is to give a new solution to the Diophantine equation

### $x^3 + y^3 = u^3+v^3, \;\;\;\;\; x,y,u,v \in \Z.\tag{1}$

The result found in this essay gives the general solution in terms of two parameters in the ring $R:=\Z\big(\sqrt{-3}\big)$.

Depending on the signs of the integers in any particular solution of (1), we obtain a solution to one or the other of

and

### $x^3 + y^3 +z^3 = w^3, \;\;\;\;\;x,y,z,w \in \Z^+.\tag{3}$

For example, the solution

### $[x,y,u,v]=[10, -1, -9, 12]$

to (1) implies the solution

### $[x,y,u,v]=[10,9,1,12],$

to (2) and the solution

### $[x,y,u,v]=[6, -4, 5, 3]$

to (1), implies the solution

### $[x,y,z,w]=[3,4,5,6]$

to (3).

The values of $x^3+y^3$ in solutions to (2) are known as Ramanujan Numbers. The historical event which made (2) into a famous problem, was recounted by C. P. Snow, in his foreword to [G. H. Hardy, 1940] . The problem was also discussed in [Joseph H. Silverman, 1993] .

In Section 2, we will consider some properties of $R$ and in section 3 we will present a solution to (1). This leads, in Section 4, to an Algorithm, for generating all possible solutions, in Section 6. Finally, in Section 5, it is shown how to construct primitive solutions, with arbitrarily large values.

2. The ring $\Z\big(\sqrt{-3}\big)$ For $\xi=a+b\sqrt{-3} \in R$, the norm is defined as $\| \xi\| = \xi\overline \xi=a^2+3b^2$. If $\xi=a+b\sqrt{-3}$, $\eta=c+d\sqrt{-3}$, then $\xi\eta =(ac-3bd) +(ad+bc)\sqrt{-3}$.

We will consider the question: which odd primes greater than $3$ are equal to $\| \xi\|$ for some $\xi$.

Lemma 1 Let $p$ be a prime greater than $3$, then there exists $a+b\sqrt{-3} \in R$ with $p\nmid a$, $p\nmid b$, such that

### $a^2+3b^2 \equiv 0 \bmod p,\tag{4}$

if and only if $p\equiv 1 \bmod 6$.

Proof Choose the integer $c$ such that $bc=1 \bmod p$ and multiply (4) by $c$ and write $d=ac$. It follows that $-3 \equiv d^2 \bmod p$, implying that, using Legendre symbols,

### $\begin{array}{rll} \big(\tfrac{-3}{p}\big)\!\!\!&= \big(\tfrac{-1}{p}\big) \big(\tfrac{3}{p}\big) \!\!\!&= (-1)^{\frac{p-1}2} (-1)^{\frac{p-1}2}\big(\tfrac{p}{3}\big)\\ &=\big(\tfrac{p}{3}\big) &=\left\{ \begin{array}{@{}rl} 1, & p\equiv 1 \bmod 6,\\ -1, & p\equiv 5 \bmod 6.\; \qed \end{array} \right. \end{array}$

Denote $P$ as the set of primes which are congruent to $1\bmod 6$. For given $p\in P$, denote $N = \{1,2,\dots, \tfrac{p-1}2\}$.
Lemma 2 Let $p \in P$, then there exist integers $a,b\in N$ such that

### $a^2+3b^2 \equiv 0 \bmod p.\tag{5}$

Proof Replace $a$ by $a'$ in (5), where $a= np \pm a'$ with $a'\in N$ and similarly for $b$. $\;\qed$
Theorem 3 Let $p\in P$; then unique $|a|$ and $|b|$ exist such that

### $a^2+3b^2 = p, \tag{6}$

Proof The proof is by induction for $p=7, 13, 19, \dots\in P$. For $p=7$, it is verified that $2^2+3 (1)^2=p$. It remains to prove the result for $p\in P$, $p>7$, where it is assumed to hold for all $q\in P$, such that $q < p$. From Lemma 2, $a,b$, exist such that $a^2+3b^2=pQ$, with $Q$ a product of prime powers. We will show that this statement is also true with $Q=1$. It is not possible that $p\mid Q$ because

### $a^2+3b^2 \leq (\tfrac{p-1}2)^2 + 3(\tfrac{p-1}2)^2 < p^2.$

The proof continues by considering a series of propositions which make it possible to exclude all possible prime divisors of $Q$. In each case, for a possible divisor $g$, we will show that there exists $a'$, $b'$ such that $a'^2+3b'^2=pQ'$ with $Q' < Q$. In this proof only, the symbol $\pmb\Rightarrow$ is used to introduce values of $a', b', Q'$.
1. $\gcd(a,b)=g>1$ $\pmb\Rightarrow$ $a'=a/g$, $b'=b/q$. $Q'=Q/g^2$.
2. $2\mid Q$.
1. $a,b$ even. This reduces to 1.
2. $a,b$ odd.
1. $4\mid (a+ b)$ $\pmb\Rightarrow$ $a'=(a-3b)/4$, $b'=(a+ b)/4$. $Q'=(Q/4)$
2. $4\mid (a- b)$ $\pmb\Rightarrow$ $a'=(a+3b)/4$, $b'=(a- b)/4$. $Q'=(Q/4)$
3. $3\mid Q$. This implies $3\mid a$ $\pmb\Rightarrow$ $a'=b$, $b'=a/3$. $Q'=Q/3$.
4. $q\mid Q$, for $q$ prime and $q\equiv 5 \bmod 6$. It follows that case 1. applies with $g=q$.
5. $q\mid Q$, for $q\in P$.
1. $q\mid a$, $q\mid b$. Reduces to case 1.
2. $q\nmid a$, $q\nmid b$. $(c+d\sqrt{-3})(c-d\sqrt{-3})(a+b\sqrt{-3})=pqQ$.
1. $q\mid (c+ d\sqrt{-3})(a+b\sqrt{-3})$ $\pmb\Rightarrow$ $a'=(ac-3bd)/q$, $b'=ad+bc$, $Q'=Q/q$.
2. $q\mid (c- d\sqrt{-3})(a+b\sqrt{-3})$ $\pmb\Rightarrow$ $a'=(ac+3bd)/q$, $b'=ad-bc$, $Q'=Q/q$.

We now consider the primes of $R$ and factorization in $R$.

Remark 4 The primes of $R$ are
• 2
• $1\pm\sqrt{-3}$
• $\sqrt{-3}$
• Prime numbers $p\equiv 5 \bmod 6$
• $a\pm b\sqrt{-3}$, with $a,b\in \Z^+$, and $a^2+3b^2\in P$.
Remark 5 The product of two primes of $R$ has unique factorization with the exception of

### $4 = 2^2 = (1 + \sqrt{-3}) (1-\sqrt{-3}).$

3. Solution to cubic equation We first state the solution to an introductory equation.
Lemma 6 The general solution to

is

### $A = ij, B = k\ell, C = ik, D = j\ell, \;\;\;\; i,j,k,\ell \in \Z^+. \tag{8}$

Proof Let $i=\gcd(A,C)$, $j=A/i$, $\ell =\gcd(B,D)$, $k=B/\ell$. $\;\qed$
Consider two Diophantine equations

### $\begin{array}{rlr} x^3+y^3 \!\!\!&= u^3+v^3,& (9)\\ \sp\sp\sp\sp\sp\sp\sp\sp a(a^2+3b^2)\!\!\! &= c(c^2+3d^2)& \sp\sp\sp \sp\sp\sp\sp\;\;\; (10) \end{array}$

We will, in each case, consider primitive solutions.
The next result is easily verified and is given without proof.
Lemma 7 $(x,y,u,v)$ is a primitive solution to (9) if and only if $(a,b,c,d)$ is a primitive solution to (10), where

with

### $\begin{array}{rl} T \!\!\!&= \left\{ \begin{array}{l l} \,\;\;\begin{bmatrix} 1 & 1\\1 & -1 \end{bmatrix}, & x+y \text{ odd},\\ \frac12\begin{bmatrix} 1 & 1\\1 & -1 \end{bmatrix}, & x+y \text{ even}, \end{array} \right.\\ T^{-1}\!\!\! &= \left\{ \begin{array}{l l} \frac12\begin{bmatrix} 1 & 1\\1 & -1 \end{bmatrix}, & x+y \text{ odd},\\ \,\;\;\begin{bmatrix} 1 & 1\\1 & -1 \end{bmatrix}, & x+y \text{ even}. \end{array} \right. \end{array}$

We will now focus on (10), but written in a slightly different form.

### \begin{align} \widetilde a(a^2+3b^2) &= \widetilde c(c^2+3d^2), \tag{11}\\ \widetilde a &= a, \sp\sp \sp\sp\widetilde c =c. & \tag{12} \end{align}

We will use Lemma 6 to solve (11) and then identify the free parameters by requiring them to satisfy (12).
Lemma 8 The general solution to (11) is

where

### \begin{alignat}{3} X &= \xi \overline \xi &&=\alpha^2+3 \beta^2,\sp & \xi &=\alpha + \beta\sqrt{-3}, \tag{17}\\ Y &= \eta\overline\eta &&= \gamma^2+3 \delta^2, & \eta &=\gamma + \delta\sqrt{-3},\tag{18}\\ Z &=\zeta\overline\zeta &&=s^2+3 t^2, & \zeta &=s + t\sqrt{-3}, \tag{19} \end{alignat}

and $r,s,t,\alpha,\beta, \gamma, \delta$ are parameters.

Proof Use Lemma 6 and note that

### $Z=\gcd(\alpha^2+3 \beta^2, \gamma^2+3 \delta^2),$

which is necessarily of the form $s^2+3 t^2$. $\;\qed$
Discussion 9 To eliminate $r,s,t$, use the conditions $\widetilde a =a$, $\widetilde c=c$ using

### \begin{alignat}2 \widetilde a &= r \zeta\overline\zeta&&= r(\gamma^2+3 \delta^2), \tag{20}\\ \widetilde c &= r \xi\overline \xi &&=r(\alpha^2+3 \beta^2), \tag{21}\\ a &= \Ree \xi\zeta&&=s\alpha - 3 t\beta, \tag{22}\\ c &= \Ree \eta\zeta &&=s\gamma - 3 t\delta, \tag{23} \end{alignat}

so that $r,s,t$ satisfy the homogeneous linear system

with solution

### $\begin{bmatrix} r\\s\\t \end{bmatrix}= G^{-1}\begin{bmatrix} 3(\beta \gamma-\alpha\delta)\\ 9(\beta^3-\delta^3) + 3(\alpha^2\beta - \gamma^2\delta)\\ \alpha^3-\gamma^3 + 3( \alpha \beta^2 - \gamma\delta^2) \end{bmatrix},$

where $G^{-1}$ is introduced to reduce $\gcd(r,s,t)$ to $1$, if necessary.

4. Algorithm and sample solutions Using the results of Lemmas 7 and 8, and Discussion 9, an algorithm can be constructed.
1. Choose $\alpha+\beta\sqrt{-3}, \gamma+\delta\sqrt{-3}\in R$
2. Evaluate $r,s,t$
3. Evaluate $a,b,c,d$
4. Evaluate $x,y,u,v$
It is found computationally that there are exactly $25$ solutions to (9) with $x^3+y^3\le 10^6$ and $31$ solutions to (10) with $w\le 100$. These are shown in Tables 1 and 2 respectively.
5. Extreme values
Theorem 10 Primitive solutions to (9), with $x,y,u,v>0$, exist with arbitrarily high values of $x^3+y^3=u^3+v^3$.
Proof For $[\alpha,\beta,\gamma,\delta]=[n,1,n,0]$ with $3\nmid n$, details of the solution are found to be

### \begin{align} [r,s,t]&=[n,n^2+3,n]\\ x&= n^3+2n^2+3,\\ y&= n^3-2n^2-3,\\ u&=n^3+n^2+3n,\\ v&=n^3-n^2+3n,\\ x^3+y^3=u^3+v^3&=2n^3(n^2+3)(n^4+9n^2+9). \end{align}

Theorem 11 Primitive solutions to (10), with $x,y,z>0$, exist with arbitrarily high values of $w$.
Proof. For $[\alpha,\beta,\gamma,\delta]=[n,1,0,n]$, with $3\nmid n$, details of the solution are found to be

### References

;[G. H. Hardy, 1940]
A Mathematician's Apology, Cambridge: Cambridge University Press.
[Joseph H. Silverman, 1993]
Taxicabs and sums of two cubes, Am. Math. Monthly 100, 331-340.

$\to$ Pastimes