Implement finding the ith digit in the sequence.