Largest prime factor

Not Finished - In Fact It's Barely Started.

I'm not too good at mathematics and thinking things through
systematically, especially at 3am...