Trying to solve 99 problem in scala  describe in http://aperiodic.net/phil/scala/s-99/