>It's very strange to me that the teacher would push the students from the correct solution using a loop, towards an incorrect solution using a logarithm
That's because the teacher here is an undergraduate student who has yet to learn from painful experience :)
That's because the teacher here is an undergraduate student who has yet to learn from painful experience :)