# Author: Manfred Scheucher # Date : 12.06.2015 from itertools import combinations from sys import argv maxdig = int(argv[1]) F = list(fibonacci_xrange(2*10^maxdig)) N = {Integer(sqrt(fb-fa)) for fa,fb in combinations(F,2) if (fb-fa).is_square()} print list(sorted(N)) print "no more terms < 10^"+str(maxdig)