You’re given an array of N 64 bit integers. N may be very large. You know that every integer 1..N appears once in the array, except there is one integer mis
The solution proposed by BrokenGlass covers the case for two unknowns (corresponding to one duplicate number and one missing number), using two formulas:

and

The formulas yield the generalized harmonic number of orders n of -1 and -2, respectively. (Power series)
This solution is generalizable for 3 unknowns by including the value of generalized harmonic number of order n of -3.

To solve for m unknowns (duplicates and missing numbers), use m generalized harmonic numbers of orders n of -1 through -m.
Moron notes that this approach was discussed earlier in StackOverflow at Easy interview question got harder.