The 3n+1 challenge is quite popular and can be found here
I've created a solution in python below and also here on github
def solution(i, j):
    count = toRtn = 1
    for n in xrange(i, j+1):
        count = 1
        while n != 1:
            if n % 2 == 0:
                n = n/2
            else:
                n = (3 * n) + 1
            count += 1
        toRtn = max(toRtn, count)
    return toRtn
print solution(100, 200)
print solution(201, 210)
I have several questions:
- Can and should this be re-written as a recursion? Whould that improve efficiency? 
- How can I calculate the complexity of this function? 
- Is there an online judge for Python for those challenges? 
 
     
     
    