Sep-26-2019, 04:54 AM
Efficiency is not very important here as only one number is checked but still I would grab low hanging fruits first and only after that deploy brute force.
'low hanging fruits':
- if number is 1 -> not prime
- if number is even -> not prime
'brute force'
- check quotient, but only by dividing with odd numbers (as we already determined that number is not even)
'low hanging fruits':
- if number is 1 -> not prime
- if number is even -> not prime
'brute force'
- check quotient, but only by dividing with odd numbers (as we already determined that number is not even)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.