How to find the least perfect square bigger than $2b^2$?

I am trying to make a visual proof of the irrationality of two. I am demonstrating the concept via the basic notion of the the are of the square, one can see that it's possible to mount a square with sides $a$, which I guess that is basically a consequence of the area of the square $a^2$, such consequence does not apply to $2b^2$.

I've managed to reduce the problem to find a perfect square that's bigger than $2b^2$, for every $b\in \mathbb{N}_{+}$ and then try to organize $2b^2$ elements inside the next perfect square bigger than $2b^2$. For example:

$$\begin{matrix} {b}&{b^2}&{2b^2}&{?}\\ {2}&{4}&{8}&{9}\\ {3}&{9}&{18}&{25}\\ {4}&{16}&{32}&{36} \end{matrix}$$

So how do I find a function that yields the next perfect square bigger than $2b^2$? It must be really trivial, but I've been thinking and nothing comes out.

Maybe this will help: you can find all solutions to $a^2 - 2 b^2 = 1$ as the left columns of $$I \; = \; \left( \begin{array}{rr} 1 & 0 \\ 0 & 1 \end{array} \right) ,$$ $$A \; = \; \left( \begin{array}{rr} 3 & 4 \\ 2 & 3 \end{array} \right) ,$$ $$A^2 \; = \; \left( \begin{array}{rr} 17 & 24 \\ 12 & 17 \end{array} \right) ,$$ $$A^3 \; = \; \left( \begin{array}{rr} 99 & 140 \\ 70 & 99 \end{array} \right) ,$$ $$A^4 \; = \; \left( \begin{array}{rr} 577 & 816 \\ 408 & 577 \end{array} \right) ,$$ and so on.

Put another way, the sequence of $a$'s, $1,3,17,99,577$ follows $a_{n+2} = 6 a_{n+1} - a_n,$ and the sequence of $b$'s, $0,2,12,70,408$ follows $b_{n+2} = 6 b_{n+1} - b_n.$

• That's what I was going to say first, but then I got distracted by what the question asked for and forgot about what it actually wanted! – MJD Apr 4 '14 at 2:28
• @MJD, right. I'm not sure what the OP wants. – Will Jagy Apr 4 '14 at 2:37

Let $n = \sqrt{2b^2} = b\sqrt2$. Let $m$ be the smallest integer that is greater than $n$. The number you want is $m^2$. In notation, it's $$\left(\left\lceil b\sqrt 2\right\rceil\right)^2.$$

• But it's just that or there is some heuristic? I usually like to capture ideas so I can do it on my own next time. – Billy Rubina Apr 4 '14 at 2:20
• @pristine I don't understand what you mean by ‘heuristic’. $x^2$ is an increasing function. This means that $a>x$ if and only if $a^2 > x^2$. You want $a^2>x^2$, so you must have $a>x$. You want $a^2$ a perfect square, so you must have $a$ an integer. You want $a^2$ as small as possible but at least $x^2$, so you must have $a$ to be the smallest integer at least as big as $x$. So that is exactly what I wrote: take $x = \sqrt{2b^2}$, find the smallest integer bigger than that, which is $a$, and then $a^2$ is the smallest square bigger than $\sqrt{2b^2}$. – MJD Apr 4 '14 at 2:24
• @PristineKavalostka: One could argue that because 2 is irrational there will never be a nice simple function that provides the answer to your question. – Foo Barrigno Apr 4 '14 at 12:13

The equation $x^2 - d y^2 = 1$ with squarefree $d$ is Pell's equation. It always has an infinitude of solutions in $\mathbb{N}$.

If you consider the ring $\mathbb{Z}[\sqrt{d}]$ (i.e., the numbers $z = a + b \sqrt{d}$ with $a, b \in \mathbb{Z}$), and define the norm $N(a + b \sqrt{d}) = a^2 - d b^2$, you see that $N(u \cdot v) = N(u) N(v)$ (easiest way to prove this is to define for $z = a + b \sqrt{d}$ its conjugate $\overline{z} = a - b \sqrt{d}$, note that $N(z) = z \cdot \overline{z}$, check that $\overline{u v} = \overline{u} \cdot \overline{v}$, and $N(u v) = u v \cdot \overline{u v} = u \overline{u} \cdot v \overline{v} = N(u) \cdot N(v)$). Units (elements which have a multiplicative inverse in $\mathbb{Z}[\sqrt{d}]$) are elements $u$ such that $N(u) = \pm 1$, i.e., they are solutions to the equation (or with the right hand side $-1$). It can be shown that all solutions to Pell's equation are powers of a fundamental unit, the minimal $z_0 > 1$ such that $N(z_0) = 1$. Units are $\pm z_0^n$, and if there is $z_1$ such that $N(z_1) = -1$, it is $z_1^2 = z_0$, and in that case $\pm z_1^n$ are all the units.

Now: $$(a + b \sqrt{d}) (e + f \sqrt{d}) = (a e + b f d) + (a f + b e) \sqrt{d}$$ Starting with the fundamental solution $z_0 = a_0 + b_0 \sqrt{d}$ (or alternatively it's square root $z_1$, if it is in the ring), you get: $$a_{n + 1} + b_{n + 1} \sqrt{d} = (a_0 a_n + b_0 b_n d) + (a_0 b_n + b_0 a_n) \sqrt{d}$$ This is a set of two recurrences for $a_n$, $b_n$.

In your case, $d = 2$. The fundamental solution is $3 + 2 \sqrt{2}$, and it's square root is $1 + \sqrt{2}$. So all units are given by $\pm(1 + \sqrt{2})^n$. They give you the sequence of approximations $a_n / b_n$ to $\sqrt{2}$: \begin{align} a_{n + 1} &= a_n + 2 b_n \\ b_{n + 1} &= b_n + a_n \end{align} starting with $a_0 = b_0 = 1$: $$\frac{1}{1}, \frac{3}{2}, \frac{7}{5}, \frac{17}{12}, \frac{41}{29}, \frac{99}{70}, \frac{239}{169}, \ldots$$

There's no nice form, it's the ceiling of $b\sqrt{2}$, squared.

• But it's just that or there is some heuristic? I usually like to capture ideas so I can do it on my own next time. – Billy Rubina Apr 4 '14 at 2:18
• Nope. It's just that – Stella Biderman Apr 4 '14 at 2:22