What is the Inverse of Repeated Square and Multiply Algorithm?
  It is well known that the repeated square and multiply algorithm is an efficient way of modular exponentiation. The obvious question to ask is if this algorithm has an inverse which would calculate the discrete logarithm efficiently. The technical hitch is in fixing the right sign of the square root and this is the heart of the discrete logarithm problem over finite fields of characteristic not equal to 2. In this paper a couple of probabilistic algorithms to compute the discrete logarithm over finite fields are given by bypassing this difficulty. One of the algorithms was inspired by the famous 3x+1 problem. 
H. Gopalkrishna Gadiyar, K M Sangeeta Maini, R. Padma and Mario Romsy