finding missing in arthmetic sequence in o(n) time