
The set of ordered pairs of integers is countably infinite. That means the ordered pairs of integers can be put in onetoone correspondence with the counting numbers, which are the positive integers. This helps us show that the set of rational numbers is countable.
How does this onetoone correspondence work? First, let's consider the "square spiral" of ordered pairs. The origin is the 0^{th} element of this sequence, and all the other ordered pairs are somewhere on the spiral. Andrew Critch asked the key question on the AlgebraOnline message board:
> > 
On 11/14/00 8:29:23 PM, Andrew Critch wrote: Can ANYBODY help me find a function to find the n^{th }element of this series? {(1,0), (1,1), (0,1), (1,1), (1,0), (1,1), (0,1), (1,1), (2,1), (2,0), ...} It's a square spiral circling out from the origin. Any help would be greatly appreciated. 
OK, Here you go, Andrew. I will give you a formula for finding x_{n} and y_{n} for any positive integer n, so that the point (x_{n},y_{n}) is the n^{th} element of the sequence you're describing. There's also a calculator you can use to quickly find the nth ordered pair. I will use intermediate variables in the calculation to make the explanation clear. The variables I will use are:
Now for the calculation...
If you have access to Microsoft Excel, then you can make a spreadsheet that calculates these values, and use an xy scatter plot to depict the graph. I'll get you started, and you can always ask if you need more info... In the first row, put your column labels: n, Shell, Leg, Element, x, y. In the second row, put your formulas.
You can cut and paste these formulas from this message right into Excel, plot the x and y columns using a scatter plot, and within a minute or two, you'll be lookin' at the square spiral! Have fun. Inverse Spiral FunctionThen, much later, someone named Ofek emailed me to ask about the inverse. That is, how can you get from an (x,y) pair to the distance from the origin, measured along the spiral? Here's the answer: Given (x,y), shell is the maximum of the distance in either dimension from the origin, in other words: max(abs(x),abs(y)) leg  if you think of the plane of ordered numbers as being inside a big "X", then the leg is the quadrant in that x. In other words,
element is the directed distance from the axis, measured along the spiral. Here are the calculations, which you can enter into your spreadsheet, assuming "x" is in column E, and "y" is in column F:
Now, no matter what integer values of (x,y) you type into the cells in columns E and F, you'll get the correct distance from the origin, measured along the spiral, in column J. 
Andrew wrote back to say he didn't understand my terminology, so I provided an example, and a calculator that gives the x, y coordinates of the n^{th} ordered pair.
The Peano Postulates  Proving the properties of natural numbers using the Peano Postulates, which have been formulated so that zero is not included in the set of natural numbers. (There's quite a debate about this point.)
Is Zero a Natural Number?  a discussion of the fact that some authors include zero, and others do not.
Introduction to Counting  explains what mathematicians mean by "counting"  that is, putting sets in onetoone correspondence.
Construction  Construction of sets of numbers, starting with the original Peano Axioms, formulated so that zero is included in the set of natural numbers.
Set Theory  an introduction to sets, including examples of some standard sets.
The webmaster and author of this Math Help site is Graeme McRae.