Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Given the number n and prime p, calculate a and b. a is p subtracted from the nearest multiple of 10. b is that same multiple of 10 divided by 10.

This part threw me for a bit until I realized that numbers that end in 5 can't be prime, other than 5 itself. And I don't really need a rule to test divisibility by 5.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: