Prove that the necessary and sufficient condition for an integer n to odd is that n2 is odd.
Let p: The integer n is odd.
And q:n2 is odd.
First we prove that p⇒q.
Let n be odd. Then, n=(2k+1) for some integer k.
Then, n2(2k+1)2=(4k2+4k+1)=2(2k2+2k)+1
Thus, n2 is 1 more than an even number and therefore, it is odd.
Thus, p⇒q.
Now, in order to prove that q⇒p. it is sufficient to show that p⇒q [contrapositive method]
Clearly, ~p: The integer n is even.
Let n=2k for some integer k.
Then , n2=4k2,which is even,
∴ n is even
⇒n2 is even.
Consequently. ~p⇒~q and therefore , q⇒p.
Hence , p⇔q,i.e. the integer n is odd if and only ifn2 is odd.