solve f(5364,7)using f(a,b)=0if a<b,f(a,b)=f(a-b,b)+1
Rewriting the function as,
f(a,b) = 0, a < b
f(a,b) = f(a-b,b) + 1, otherwise.
Taking f(a,b) as f(5364, 7), then a = 5364, b = 7
Since a > b, then f(5364, 7) = f(5364 – 7, 7) + 1= f(5357, 7) +1
Continuing in the same vein,
f(5364, 7) = f(5357, 7) +1 = f(5350, 7) + 2
f(5364, 7) = f(5350, 7) + 2 = f(5343, 7) + 3
...
f(5364, 7) = f(5343, 7) + 3 = f(9, 7) + 762 + 3 (Subtract 7 (b) from 5343 (a) 762 times, and add 1 each time)
f(5364, 7) = f(2, 7) + 1 + 765
f(5364, 7) = 0 + 766 (f(2, 7) = 0 since 2 < 7)
Answer: f(5364, 7) = 766