Apatel91Answering to your PM
A perfect square is a number which has even exponents of all it's prime factors
So the first case is the numbers whose exponents are even e,g, 2^2, 4^4, 6^6, 8^8 etc.
We have 2017 numbers i.e. their powers also are from 1 to 2017 so the even exponents cases will be the count of even numbers from 1 to 2017 i.e. 1008
Now, there may be some number which are such as 9^9 these numbers are perfect squares because their base (9) itself is a perfect square.
Such numbers = all perfect squares from 1 to 2017 which is 44
But there may be several common numbers such as 4^4, 16^16 which have been considered in the previous two cases so we need to exclude them
These numbers will be even perfect square to the power even
From 1 to 2017, we have 44 perfect squares and 22 of them are even so we subtracted these 22 cases
I hope this helps now!!!