(EDIT: this doesn't work, as lisper pointed out below)<p>I haven't worked out the details or explicitly proven that this will work, but I think the following algorithm should do it:<p>1) Count up the number of even numbers in the list and compare it to the number we'd expect if the list was "right". This will either be correct (in which case both missing and dupe are even, or both are odd), high (the missing one was odd and the duped one was even), or low (the missing one was even and the duped one was odd).<p>If high or low, we've just pinned down the last binary digit of each of the numbers.<p>If even, the digit remains in an unknown state.<p>2) Slice off the last digit.<p>3) Repeat 1) and 2) for all 64 bits.<p>4) Now we have our missing number in the form 001001x1...xx01x (64 bits worth), where the x's represent digits where the missing number's digit matches the duped one.<p>5) We know the difference between the missing and duped numbers because of the triangular sum formula N(N+1)/2. Use that to solve for the xs in the missing number. That equation will <i>not</i> be possible to solve in general, but the statement of the problem here assures us that it will have a solution; further, I'm pretty sure that as long as the duped and missing numbers are not equal, that solution will be unique (EDIT: it's not, and this method doesn't work at all :P ).<p>Maybe I'm missing something, though? Haven't thought this through too deeply...