Parameterization of modular group Is there a parameterization by integers of the modular group SL(2,Z)? What I mean is, some expression for a matrix in terms of several variables (a,b,c,...) such that for each n-tuple of integers (a,b,c,...), the expression produces a (preferably distinct) unimodular matrix.
As an example of what I mean, think of Pythagorean triples. It's easy to say "Pythagorean triples are countably infinite, therefore a bijection Z <-> Pythagorean triples exists, QED", but that doesn't actually help you, e.g. write a computer program to generate them, does it? But an explicit parameterization does exist, viz. (a(b^2-c^2), 2abc, a(b^2+c^2)) for integers a, b, and c.
Does a similar explicit parameterization exist for unimodular matrices of integers?
 A: In the comments Theo refers to the classical result that the matrices $S = \left[ \begin{array}{cc} 0 & -1 \\\ 1 & 0 \end{array} \right], T = \left[ \begin{array}{cc} 1 & 1 \\\ 0 & 1 \end{array} \right]$ generate $\text{SL}_2(\mathbb{Z})$, and in fact we know exactly what the relations are: they are $S^2 = (ST)^3 = -1$ (where $-1$ is a central element of order $2$). This is essentially an application of the Euclidean algorithm, although generally the first place you will read about it is a book on modular forms, where it is more interesting to give a geometric proof in terms of the action on the upper half plane. See, for example, the last section of Serre's A Course in Arithmetic. 
Whether this counts as a parameterization of the modular group is up to you. Until you are more precise I don't know if this is the kind of answer you're looking for.
In practice, if all you want to do is generate a lot of elements of $\text{SL}_2(\mathbb{Z})$, it seems easier to me to pick two random integers and apply the extended Euclidean algorithm to them. Of course, the above result also gives an explicit algorithm that will generate all elements of $\text{SL}_2(\mathbb{Z})$ since it is easy to recursively generate words in two letters. 
A: This paper (free access) answers your question theoretically, but the result doesn't look useful in practice.
If you Google for "parametrization of the modular group", you get this paper, which you can rent for a day for $0.99; the Google context says "Therefore, we have a complete parametrization of the modular group". (I didn't rent it to look inside.)
Here's another paper that appears to address the question.
This dissertation says "there is no polynomial parametrization in three integer variables of $SL_2(\mathbb{Z})$".
Since you mention the parametrization of the Pythagorean triples: this parametrization of $SL_2(\mathbb{R})$ uses matrices of trigonometric and hyperbolic functions that can be restricted to rational values using Pythagorean triples:
$$\left(\begin{array}{cc}\cosh\theta&\sinh\theta\\\sinh\theta&\cosh\theta\end{array}\right)=
\left(\begin{array}{cc}\frac{c}{b} & \pm \frac{a}{b}\\\pm \frac{a}{b} & \frac{c}{b}\end{array}\right)\;,
$$
$$\left(\begin{array}{cc}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{array}\right)=
\left(\begin{array}{cc}\pm\frac{a}{c} & \mp \frac{b}{c}\\\pm \frac{b}{c} & \pm\frac{a}{c}\end{array}\right)\;.
$$
Conversely, $\cos\theta=a/r$ and $\sin\theta=b/s$ in reduced form yields
$$\left(\frac{a}{r}\right)^2+\left(\frac{b}{s}\right)^2=1\;,$$
which is only possible if $r=s=c$ and thus $a$, $b$ and $c$ form a Pythagorean triple; and similarly for the hyperbolic case. This yields a parametrization of $SL_2(\mathbb{Q})$, but I'm afraid it doesn't help you much with $SL_2(\mathbb{Z})$, since I don't see how to get rid of the denominator or how to deal with the diagonal matrices $d_1$ and $d_2$ in the integer case.
P.S.: A more pedestrian way of enumerating the matrices in $SL_2(\mathbb{Z})$ would be to enumerate the pairs of coprime integers $a$, $b$, solve $ad-bc=1$ for $c$ and $d$, and use all tuples of the form $(a,b,c+na,d+nb)$.
