In this example we're going to plan and write a function that takes one integer N and determine if it is prime. We begin with step 1, working at least one instance by hand. We might start with something like is 7 prime and you might just say, yes, I know this, 7 is prime. However, this is not very helpful. Just knowing the answer does not help us develop a step-by-step approach to solving the general problem. Unfortunately, when you already know the answer, it can be hard to see past it, in which case, there are two things you could do. First, you could consider how you would convince someone that this is right. That is, if you said 7 is prime, and I said I don't believe it, what would you do step-by-step to show me that it is? Second, you might think about a harder problem where you don't just know the answer to see the step-by-step approach you take. If that problem is too big to work through all the way, you might use the step-by-step approach, you begin with to inform how you work through a more manageable size example. As an example of a harder problem let us consider whether 29,393 is prime. I suspect most of you do not know the answer off the top of your head. We'll start with step 1. I divided by 2 and get 14,696 remainder 1. Dividing by 3 gives 9,797 remainder 2. Dividing by 4 gives 7,348 remainder 1. Dividing by 5 gives 5,878 remainder 3. Dividing by 6 gives 4,898 remainder 5. Dividing by 7 gives 4,199 remainder 0. Because my number is evenly divisible by 7, I will answer no, 29,393 is not prime. Next I'll write down exactly what I did, and this involves thinking through my actions and describing the steps to get the answer. I checked if 29,393 mod 2 is 0, that is, if it's evenly divisible by 2. It was not. Then I checked if it was divisible by 3. If mod 3 is equal to 0, it was not. Then I checked whether it was divisible by 4, divisible by 5, divisible by 6, divisible by 7. The answer was yes, when I found that it was divisible by 7 I answered no. The next step is generalizing the result of step 2, but we may wish to make multiple instances of steps 1 and 1 first. In this problem in particular since we have a yes or no question it may be very useful to do an instance where we get a yes answer before we try to generalize. Now we return to our first question, is 7 prime? Having already thought through how to do it step-by-step, we may be able to get past a mental road block of just knowing the answer. 7/2 = 3 remainder 1. 7/3 = 2 remainder 1. 7/4 = 1 remainder 3. 7/5 = 1 remainder 2. 7/6 is 1 remainder 1. So at this point, I'm going to answer yes, 7 is prime. I tried all the numbers from 2 to 6 and found 7 is not divisible by any of them. Doing step 2 for the same problem, I'm going to write down that I checked 7 mod 2 is 0, it is not. Checked if 7 mod 3 is 0. It is not. Checked if 7 mod 4 is 0. Checked if 7 mod 5 is 0. Checked if 7 mod 6 is 0. And after doing all that and verifying that the answer was no for all of them I answered yes.