You are viewing a single comment's thread. Return to all comments →
The most beautiful implementation
if(n<2){ return 0; } else if(n<6){ return 1; } else if(n<30){ return 2; } else if(n<210){ return 3; } else if(n<2310){ return 4; } else if(n<30030){ return 5; } else if(n<510510){ return 6; } else if(n<9699690){ return 7; } else if(n<223092870){ return 8; } else if(n<6469693230){ return 9; } else if(n<200560490130){ return 10; } else if(n<7420738134810){ return 11; } else if(n<304250263527210){ return 12; } else if(n<13082761331670030){ return 13; } else if(n<614889782588491410){ return 14; } return 15;
Seems like cookies are disabled on this browser, please enable them to open this website
Leonardo's Prime Factors
You are viewing a single comment's thread. Return to all comments →
The most beautiful implementation
if(n<2){ return 0; } else if(n<6){ return 1; } else if(n<30){ return 2; } else if(n<210){ return 3; } else if(n<2310){ return 4; } else if(n<30030){ return 5; } else if(n<510510){ return 6; } else if(n<9699690){ return 7; } else if(n<223092870){ return 8; } else if(n<6469693230){ return 9; } else if(n<200560490130){ return 10; } else if(n<7420738134810){ return 11; } else if(n<304250263527210){ return 12; } else if(n<13082761331670030){ return 13; } else if(n<614889782588491410){ return 14; } return 15;