First sequence with no square differences Consider the sequence \$(a_n)\$ defined in the following way.

\$a_0=0\$
For all \$n=1, 2, 3, \dots\$, define \$a_n\$ to be the smallest positive integer such that \$a_n-a_i\$ is not a square number, for any \$0\leq i&lt;n\$

In other words, this is the lexicographically first sequence where no two terms differ by a square. It is proven that this sequence is infinite, and it is A030193 in the OEIS. The sequence begins
0, 2, 5, 7, 10, 12, 15, 17, 20, 22, 34, 39, 44, 52, 57, 62, 65, 67, 72, 85, 95, 109, 119, 124, 127, 130, 132, 137, 142, 147, 150, 170, 177, 180, 182, 187, 192, 197, 204, 210, 215, 238, 243, 249, 255, 257, 260, 262, 267,...
Challenge
The challenge is to write a program or function which does one of these:

Takes a nonnegative integer n and returns or prints the n-th term of this sequence. Either 1-indexed or 0-indexed is acceptable.

Takes a positive integer n and returns or prints the first n terms of this sequence

Takes no input and returns or prints all terms of the sequence with an infinite loop or infinite list


Any reasonable form of input and output is allowed.
Example (0-indexed)
Input -&gt; Output
0     -&gt; 0
10    -&gt; 34
40    -&gt; 215

Rules

Standard loopholes forbidden.

Code golf: shortest program in bytes for each language wins.
Ruby, 72 62 57 50 47 bytes

0.step{|x|$*&lt;&lt;p(x)if$*.all?{|i|(x-i)**0.5%1&gt;0}}

Try it online!
Prints all terms of the sequence indefinitely.
7 bytes saved by Dingus and further 3 by Sisyphus.
Ruby 2.7+, 45 bytes

0.step{|x|$*&lt;&lt;p(x)if$*.all?{(x-_1)**0.5%1&gt;0}}