Show that if $p$ is a prime such that $p|(2^{64}+1)$ then $p \equiv 1 $ (mod 128) I'm not sure if I'm on the right track with this problem. So far I've said: $2^{64} = (2^{32})^2 \equiv -1$ (mod p). Then by Fermat's two square theorem $p = 2$ or $p \equiv 1$ (mod 4). We know $p \not = 2$ because $p|(2^{64}+1)$. Then $p \equiv 1$ (mod 4). From here I'm unsure on how to proceed. 

Edit: I misread and thought you wrote $p|2^{2^{64}}+1$. The result happens to hold as well, and it is actually the number Euler was trying to factor when he proved the theorem below.

Hint: You are on the right track since what you need is a generalization of Fermat's two-square theorem, due to Euler who used it to prove that not all Fermat's numbers are primes.

Theorem (Euler). For any coprime integers $a$ and $b$ with $a$ even, and any integer $n$, the prime factors of the sum $$a^{2^n}+b^{2^n}$$ will all be
  congruent to $1\bmod2^{n+1}$.

