Академический Документы
Профессиональный Документы
Культура Документы
n or b
n.
Problem 5.1: Decide whether 17 is prime using the stupid way.
Solution to 5.1: 4 <
17 < 5, so we only have to check 17/2 = 8(1), 17/3 = 5(2), 17/4 = 4(1).
So if you divide 17 by all integers from 2 to [
n So it is enough to
check every prime
n.
Problem 5.1: Decide whether 17 is prime using the OK way.
Solution to 5.1: 4 <