added test case for factors appearing multiple times (e.g. 4 = 2*2)

The problem asks for prime factors, not only a list of prime numbers which divide the number.
This means that if a factor appears multiple times, you have to return it multiple times. E.g. for 4 the result should be {2,2}, factors(9) == {3,3} etc.