Rent or buy?

Compared on net position after N years — not on which monthly payment is smaller. Renting almost always wins that one, which is why it is the wrong question.