def gm(a, b, c): if g(a, b) == g(b, c) == g(a, c) == 1: return True
def gm(a,b,c): if g(a,b)>1:return False #if g(b,c)>1:return False #if g(a,c)>1:return False return True
if (len(s0)==1 and len(f[i])>1) or (len(s0)==2 and len(f[i])>2) or (len(s0)==3 and len(f[i])>3):l.append(i) l = sorted(l) print "done." # for x in l: # print x, # exit() for c in l: for a in l: s1=set(f[c]) #if len(s1)>2:continue #a = c-b if a>c/2:break b = c-a #if a>=b:continue if g(a,b)==1 : #n = a*b*c #if (n-1)%2==0:print "odd",a,b,c,n #s1=set(f[c]) s2=set(f[b]) s3=set(f[a]) #isPower=(len(s1)==1) s = s1.union(s2.union(s3)) #s = s.union(s3) v = reduce(mul,s) if v<c: #print a,b,c,":",s,s1,RetFact(c) ctr+=c #if not isPower:break print "count is", ctr print "time elapsed is", time()-st
def gm(a, b, c): if g(a, b) > 1: return False #if g(b,c)>1:return False #if g(a,c)>1:return False return True
def gm2(a, b, c): if g(a, b) == g(b, c) == g(a, c) == 1: return True
l.append(i) l = sorted(l) print "done." # for x in l: # print x, # exit() for c in l: for a in l: s1 = set(f[c]) #if len(s1)>2:continue #a = c-b if a > c / 2: break b = c - a #if a>=b:continue if g(a, b) == 1: #n = a*b*c #if (n-1)%2==0:print "odd",a,b,c,n #s1=set(f[c]) s2 = set(f[b]) s3 = set(f[a]) #isPower=(len(s1)==1) s = s1.union(s2.union(s3)) #s = s.union(s3) v = reduce(mul, s) if v < c: #print a,b,c,":",s,s1,RetFact(c) ctr += c #if not isPower:break print "count is", ctr print "time elapsed is", time() - st