+ 1

Helpz!

well, i need to find the largest prime factor of 600851475143. But my code only return the second largest prime factor. https://code.sololearn.com/W67E6HXBvH9I/?ref=app

3rd Aug 2018, 1:31 AM
dend
2 Answers
0
var i=600851475143,z=2,d; while (z<=i){ if (i%z===0){ i/=z; d=z; z=1; } z+=1; } document.write (d);
3rd Aug 2018, 10:38 AM
Daniel
0
thank you ^^
3rd Aug 2018, 10:43 AM
dend