Question: Please code in Python by using Jupyter notebook if possible. Also use typeset in LaTeX wherever math equations are used in the codes. Part 3

Please code in Python by using Jupyter notebook if possible. Also use typeset in LaTeX wherever math equations are used in the codes.
Part 3 Prime numbers satisfy another property. If one has three integers m, n and k we say m and n are congruent modulo k if the remainder from dividing m by A is the same as the remainder from dividing n by k. We can then write m n( mod k). For instance, the numbers 19 and 47 are congruent modulo 7 since 19-2 7+5 and 47-6 7 + 5. The remainder from division of both 19 and 47 by 7 is5 The congruence relation is preserved by arithmetic operations. If mn1( mod k) and m22 mod k), then mi +m2 nn2 mod k) and mm2 nin2 mod k) Prime numbers and congruences are related. There is a theorem that states: If p is a prime number, then ap a( mod p) for any integer p > a 0. For instance, for p 3, we observe 131 mod 3) 282 mod 3) 3273( mod 3) 4644 mod 3) Therefore, p 3 satisfies aamod p). Here, we have tried out a 1,2,3, 4 although 4 is not guaranteed to work. This relation does not in general hold true for composite numbers 1. Write a function listPrimeLike (n) which accepts n as an input and using the congruence returns the list of prime-like n relation check. umbers less than n 2. Write a function nPrimeLike (n) which accepts n as an input and re- turns the first n number of prime-like numbers using the congruence rela- tion
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
