Let
S=12−22+32−42+....+(2021)2−(2022)2+(2023)2
⇒S=(1−2)(1+2)+(3−4)(3+4)+....+(2021−2022)(2021+2022)+(2023)2
⇒S=−[3+7+11+15+....+4043]+(2023)2
The number of terms in the bracket are 22022=1011⇒S=−21011(6+1010×4)+(2023)2
⇒S=−1011×2023+(2023)2
⇒S=2023×1012
⇒S=172×7×1012
So,
m=17,n=7 and gcd(17,7)=1
Hence, m2−n2=172−72=240
Hence this is the correct option.