Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Euclidean Algorithm

hi, I wright these commands in sage to have Euclidean Algorithm but i just get error.. what is the problem of these algorithm? am I wright it in a wrong way? by the way how can I create a file named euclid.sage and save below command in it?

Begin euclid.sage

r=a%b print (a,b,r) while r != 0: a=b; b=r r=a%b print (a,b,r)

End euclid.sage

Euclidean Algorithmalgorithm

hi, Hi,

I wright wrote these commands in sage to have Euclidean Algorithm algorithm but i just I only get an error.. what is the problem of these algorithm? am I wright it in a wrong way? this algorithm?

r=a%b
print (a,b,r)
while r != 0:
    a=b; b=r
    r=a%b
    print (a,b,r)

by the way how can I create a file named euclid.sage and save below the above command in it?

Begin euclid.sage

r=a%b print (a,b,r) while r != 0: a=b; b=r r=a%b print (a,b,r)

End euclid.sage