User blog comment:Alemagno12/How strong is this function?/@comment-1605058-20171028095436/@comment-1605058-20171029085730

Note that any square-free word is automatically cube-free too, so the infinite word showing your original f(3) is undefined also makes the new f(3) undefined. Indeed, relaxing the condition makes it even worse, since now even f(2) is undefined.

In general, if you have a function of the sort you give, then relaxing the conditions (allowing squares as long as there are no cubes) will never make it well-defined; you ought to make the rules more restrictive (trivial example: don't allow any substring to repeat anywhere).