A magician places $N = 64$ coins in a row on a table, then leaves the room. A person from the audience is then asked to flip each coin however he likes [so there are $2^{64}$ possible states]. He is also asked to mention a number between 1 and $N$. After this, the magician's assistant flips exactly one coin. The magician reenters the room, looks at the coins and "guesses" the number chosen by the audience.
What is their strategy? For which values of $N$ can the trick be performed?