Minimum of $n$? $123456789x^2 - 987654321y^2 =n$ ($x$,$y$ and $n$ are positive integers) What is the minimum of $n$?
$x$,$y$ and $n$ are positive integers, find the minimum of $n$, such that:

$123456789x^2 - 987654321y^2 =n$

 A: I personally like to think in terms of Conway's topograph.  One observation in the first chapter of Conway's The Sensual (Quadratic) Forms is the fact that the smallest values (both positive and negative) of an indefinite binary quadratic form can be found along the "river".  So one way to answer this question is to move along the river and examine values we encounter.
Let $f(x,y) = 123456789x^2 - 987654321y^2$.  We know one set of values along the river:
$$\{ f(1,0), f(1,1), f(0,1) \} = \{ 123456789, -864197532,-987654321 \}$$
The set of values to the right of $\{ a, b, c \}$, where $a > 0$ and $b < 0$, is either $\{ c, b, 2(b+c) - a \}$ if $c > 0$ or $\{ a, c, 2(a+c) - b \}$ if $c < 0$.  There are only finitely many triples we can get this way, i.e. the river is periodic.
How do we know it is time to stop?  We can either iterate until the initial triple (or its permutation) shows up again or we can cheat by making use of the fact that the period is 3861006.  In the language of Conway's topograph, there are 3861006 instances of $c$ becoming positive before the river repeats itself.
Here is a naive Mathematica implementation of the algorithm:
counter = 0;
conwayRiver[{a_?Positive, b_?Negative, c_}] := If[c > 0, counter++; {c, b, 2 (b + c) - a}, {a, c, 2 (a + c) - b}];
list = NestWhileList[conwayRiver, {a, b, c}, counter < 4000000 &];
positiveList = Select[Flatten[list], Positive];
Min[positiveList]
The whole thing takes about 3 minutes on my laptop, so it is definitely less efficient than the approach using continued fractions.  However, Conway's topograph is very versatile.  For example, it also provides a straightforward algorithm to solve the representation problem:  given an integer $n$, to decide if it is a value of the quadratic form.
