Timeline for Is it almost-prime?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 29, 2023 at 9:09 | comment | added | Neil | @Deadcode Strictly speaking it doesn't check that p is the smallest prime factor at the end, since the loop would otherwise be capable of iterating again. | |
| Mar 29, 2023 at 9:08 | history | edited | Neil | CC BY-SA 4.0 | added 70 characters in body |
| Mar 29, 2023 at 7:33 | comment | added | Deadcode | -7 bytes while keeping the same algorithm. You only need to verify that \1 is still the smallest prime factor at the end, not at each iteration of the loop: Try it online! BTW, in contrast with my answer, this one intrinsically doesn't treat 1 as a prime power – which can actually be useful. | |
| Aug 26, 2020 at 10:11 | history | answered | Neil | CC BY-SA 4.0 |