Project Euler 139

@see http://projecteuler.net/index.php?section=problems&id=139