you are wrongpls look at the question again. saying if 2^p+1 is a prime, then p is the power of 2. You just showed that the reverse statement is wrong. The original statement is correct.
come inif n is not a power of 2, then there exists an odd prime dividing n, say p. then, n=pq.
then,
2^n+1=2^pq+1=(2^q+1)(2^(p-1)q-2^(p-2)q+...+2^2q-2^q+1)
and p is odd, LHS=RHS.
QED.