p-99 problems in scala (http://aperiodic.net/phil/scala/s-99/)