This one was kinda bitchy and the solution I came with for the second feels a bit 
hacky compared to one I did for the first one.

http://2600hertz.wordpress.com/2010/03/20/the-mystery-spiral/
http://community.topcoder.com/stat?c=problem_statement&pm=6093