http://www.wolframalpha.com/input/?i=y%5E2+%3D+%7Ccos%28pi*x%2F2%29%7C
The generation for the infinite string of circles on $y = 0$.
Is there a relation that generates an infinite number of square adjacent packed circles on the cartesian plane?
How about hexagonally adjacent packing?
There isn't one single relation that will create square or hexagonal packings. However, if you allow piecewise functions, you can easily make "functions".
I believe that the function given above does not give circles, as the Julián Aguirre mentioned. This is because the slope of the above function never approaches infinity (it peaks at $\frac{\pi}{2}$), whereas a function that would output circles would be vertical.