Uncomment for mathJax 3 February 2021

3 February 2021

Prime Numbers

Definition. An integer \(n\gt 2\) is prime if its only divisors are 1 and iitself.

Theorem. Every integer \(n\ge 2\) is factorable into primes. Moreover, this factorization is unique up to order.

We are going to develop an algorithm for testing for primality, is_prime(n) which returns True iff n is prime.

Some In-Class Fun I call your attention to page 10 in s5.pdf. Let's develop soutions to these four problems.

8 is a divisor of 896
112
19 is a divisor of 361

what is true of each pair

The square of one is <= to the number

what can you say about the number of divisors of a number?

1 2 3 4 6 8 12 16 24 48

225

1 3 5 9 15 25 45 75 225

if the number is a perfect square, the number of divisor is odd
all others have an even number of divisors

L

Friday Open Lab

We have some interesting warmups in Canvas for you to dig into.