sovled euler47, very happy with implementation