FANDOM


Problem 3Edit

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

CodeEdit

new number cur 600851475143
new number div 2
new number lar 1
new string last tru
new number t
hereis loop
if &last = fal add
hereis eadd
set #t #cur % #div
if #t ! 0 w
set #cur #cur / #div
set &last tru
hereis ew
if #div >> #cur end
goto loop
hereis add
set #div #div + 1
goto eadd
hereis w
set &last fal
goto ew
hereis end
write #div