# [Husk], 10 bytes

    #ȯΠṁoẊ≠½Qπ

[Try it online!][TIO-kysonn95] or [Try first elements of first few test cases](https://tio.run/##AS4A0f9odXNr/1ThuarigoEoxYA2KSjhuKM1Kf8jyK/OoOG5gW/huoriiaDCvVHPgP//)

[Husk]: https://github.com/barbuz/Husk
[TIO-kysonn95]: https://tio.run/##ASAA3/9odXNr//8jyK/OoOG5gW/huoriiaDCvVHPgP///zX/Mw "Husk – Try It Online"

Input is arg1=```k```, arg2=```n```.  Outputs number of square-free words of length ```n```, using an alphabet with ```k``` symbols.

```
         π  # Cartesian arg2-th power of range [1..arg1] 
#ȯ			# how many truthy elements of the following function:
        Q	#   get all contiguous sublists
   ṁo 		#   and for each of them:
       ½	#     split them in half
     Ẋ≠		#     and check if both halves are unequal
  Π			#   now take the product of all of that 
  			#   (so product is zero if any sublist contained
  			#   non-unequal halves, non-zero [truthy] otherwise)
```