Mysterious Function

Can you identify the function f(x,y) which takes two positive integers as its argument?

1
2
3
4
5
6
7
8
9
def f(x,y):
    minimum = min(x,y)
    maximum = max(x,y)
    if minimum == 0:
        return maximum
    elif minimum == 1:
        return 1
    else:
        return f(minimum,maximum-minimum)

×

Problem Loading...

Note Loading...

Set Loading...