This question already has an answer here:
First notice that each element in S can be rewritten as:
$4(25m+2) +3$ where m is an integer, the next step is to realise that all squares leave a remainder of either 1 or 0 when divided by 4.
As $(2n)^2 = 4n^2$ which clearly leaves a remainder of 0 when divided by 4
And for odd squares: $(2n-1)^2 = 4n^2 -4n +1$ which clearly leaves a remainder of 1 upon division by 4.
But by writing each element of S as $4(25m+2) +3$ we see that it leaves a remainder of 3 when divided by 4, therefore it can never be a perfect square.
Each number is of the form $(10^k – 1)/9$. Thus it is a perfect square if and only if $10^k – 1$ is a perfect square. But notice that for $k \ge 2$ we have $10^k – 1 \equiv 3 {\pmod 4}$, and every square is either $0$ or $1$ modulo $4$.
Hint: Notice that all numbers are $-1 \pmod 8$ except $11$.
In base 3, $11111 = 102^2$, and in base 7, $1111 = 26^2$. So it’s not true for bases in general. In base 10, all such numbers are 3 modulo 4, which is never a square.