I've spent a couple of weeks of the summer holidays as a teenager deluding myself I could solve Fermat's last theorem. Far from being wasted time, it was one of the best learning experiences of my life.