Testing if a word that contains no short squares is square free can be done in a more efficient and simpler way than with the methods treating ordinary words. This is the object of the problem.
A word $w$ is said to be almost square free if it does not contain any square factor of length smaller than $|w|/2$. Such words have a useful property stated in the observation, in which $\Occur(z,w)$ denotes the set of starting positions of occurrences of $z$ in the word $w$.
Observation 1. If $z$ is a factor of length $|w|/8$ of an almost square-free word $w$, then $z$ is non-periodic (its smallest period is larger than $|z|/2$), $|\Occur(z,w)|\lt 8$ and $\Occur(z,w)$ can be computed in linear time and constant space.
Under the hypothesis of the observation, the computation of $\Occur(z,w)$ is realised, for example, by Algorithm NaiveSearch, a naive version of Algorithm KMP.