the sheep will be safe if n ia an even number
the sheep would remain safe if there is an even number of lions on the island, and would be eaten immediately if there is an odd number of lions on the island.
Here's the reasoning:
Consider a scenario with just one lion and one sheep: The lion will eat the sheep. Why? Because after he eats it and turns into a sheep himself, there aren't any lions on the island to eat him, so he is happy.
Now look at a scenario with 2 lions and 1 sheep. Here the sheep would remain unharmed. Why? Because if any one of them eats it, and turns into a sheep himself, he knows that he awaits certain death because he will then be a sheep and the other lion will be the only lion on the island and nothing will stop him from eating the sheep.
So now we know for a fact 1 lion and 1 sheep - sheep gets eaten. 2 lions and 1 sheep - sheep doesn't get eaten.
We can now make a conclusion about 3 lions and 1 sheep: the sheep will definitely be eaten, because the lion that eats it will know that by eating he leaves behind 2 lions and 1 sheep (himself). And as we already know 2 lions and 1 sheep is a situation where the sheep survives.
You can use the same logic to go on to 4 lions and 1 sheep, and then all the way to 100 or 1000, but it will always be true that with an odd number of lions the sheep gets eaten and with an even number the sheep doesn't.