1. Identify the generated numbers The problem states that the program generates positive integers greater than 10 that have no factor p such that 1<p< generated number.
By definition , an integer that has no factor other than 1 and itself is a
prime number.Therefore, the program is generating
prime numbers greater than 10. 2. Determine possible Reminders Let n be the number generated and r be the reminder
n= 18k +r
where 0
<r<18
For n to be prime , the reminder r can not share any factor with 18. If r and 18 shared a common factor (like 2 or 3 ) then n would also be divisible by that factor , meaning n would not be prime.
The prime factors of 18 are 2 and 3 ( 18 = 2 * 3^2)
Therefore r can not be divisible by 2 or 3
3. Candidates for r Lets look all integers from 1 to 17 and eliminate those divisible by 2 or 3 :
2,4,6,8,10,12,14,16 and 3,9,15
The remaining possibilities for r are :
1,5,7,11,13,17Hence there are 6 distinct reminders
Correct answer : D