Try CoCalc Published Files Email HelpDocumentationSign In
Path: DirectoryAttack.sagews
License: none
Image: ubuntu2004
Project: Math307Attacks
Edit | Raw | Embed | Download
def DirectoryAttack(A,B=[]): if len(B)<1: B=A for i in xrange(0,len(A)): for j in xrange(0,len(B)): ijgcd = gcd(A[i],B[j]) if (ijgcd>1) and (A[i]!=B[j]): print ("The common factor of {0} and {1} is {2}".format(A[i],B[j],ijgcd))
DirectoryAttack([1,2,3],[3,6,7])
The common factor of 2 and 6 is 2 The common factor of 3 and 6 is 3