the equation is n^2-n+2

let n=1 then

1^2-1+2=2 which is divisible by 2 hence its true for n=1.

now let it be true for n=k therfor

k^2-k+2=2r

now let us consider n=k+1

(k+1)^2-(k+1)+2

=k^2+1+2k-k-1+2

=[k^2-k+2]+2k

=2r+2k

=2(r+k) which is divisible by 2

hence whenever it is true for k it is also true for k+1

hence by PMI n^2-n+2 is divisible by 2