Hi,
I'm trying to solve this one assignment we have in PHP.

Based on the given number n, the script is supposed to print out a n*n grid of numbers following the pattern in this image:
http://img222.imageshack.us/img222/4623/79890400.png

In this example the given number n is 4.

Would any of you have an idea for a good algorithm?