For what value of n would g(375,n) return 4?
def g(m,n):
res = 0
while m >= n:
(res,m) = (res+1,m/n)
return(res)
def g(m,n):
res = 0
while m >= n:
(res,m) = (res+1,m/n)
return(res)
g(375,4)
#The value of n at which g(375,n) = 4 is n = 4
4
Comments
Leave a comment