If we haven 't yet found  the missing number for  current length. Next  number is n+2. Note  that we use Log10 as  (n+2) may have more  length than n.
if ( ( missingNo == - 1 ) and ( getValue ( Str , i , 1 + int ( math . log10 ( n + 2 ) ) ) == n + 2 ) ) : NEW_LINE INDENT missingNo = n + 1 NEW_LINE n += 2 NEW_LINE DEDENT