I am trying to submit the 3n+1 problem at online Judge and have used many things but the result always is Time limit exceeded. I know there is a limit of 3 seconds
3n+1