I had a really complicated solution where I tried to generate an Phi Sieve and had to work around a lot of corner cases.
Then I looked at [this](http://www.mathblog.dk/project-euler-69-find-the-value-of-n-%E2%89%A4-1000000-for-which-n%CF%86n-is-a-maximum/) solution and - well - it's faster and simpler than mine.
So I translated it to befunge.