Definition: An integer p>1 is said to be prime if the only positive divisors of p are 1 and p itself.
Note that 1 is not prime.The smallest prime is 2 ( even) and all other primes (such as 3,5,7,11...) are odd.An integer n>1 which is not prime (such as 4,6,8,9....) is said to be composite; such an integer has the form n=ab, where 1<a<n and 1<b<n
Let p be a prime and a and b are any integers. Then
1)either p|a or p and a are coprime.
Proof: by definition gcd(a,p) is a positive divisor of p, so it must be 1 or p since p is prime.If gcd(a,p)=p, then since gcd(a,p) divides a we have p|a; if gcd(a,p)=1, then a and p are coprime.
Example:
gcd(15,5)=5, so 5|15
gcd(7,5)=1, so 7,5 are coprime
2)if p|ab, then p|a or p|b
Proof:Let p|ab. If p does not divide a then gcd(a,p)=1.Now using Bezout's identity 1=ax+py, for some x and y, so b=axb+pyb.Based on our assumption p|ab it is clear that p|b,ie; p|a or p|b
Note: if p is prime and p divides a1,a2,…,ak, then p divides ai for some i.
Example:
5|3.5 implies that 5|5
3|7.3 implies that 3|3
Fundamental Theorem of Arithmetic
This asserts that every integer n>1 can be written in an essentially unique way, as a product of prime powers. This allows many number theoretic problems to be reduced to questions about prime numbers.
Theorem:
every integer n>1 has a prime power factorization
n=pe11pe22…pekk
where p1,p2,…,pk are distinct primes and e1,e2,…,ek are positive integers; this factorization is unique, apart from the permutation of factors.
Example: 200 has the prime power factorization 23.52, or alternatively 52.23 if we permute the factors.But it has no other prime-power factorization.
Suppose that integers a and b have factorizations
a=pe11…pekkandb=pf11…pfkk
where we have ei,fi>=0 to allow for the possibility that some primes pi may divide one but not both of a and b. Then we have
ab=pe1+f11…pek+fkk
a/b=pe1−f11…pek−fkkifb|a
am=pme11…pmekk
gcd(a,b)=pmin(e1,f1)1…pmin(ek,fk)k
lcm(a,b)=pmax(e1,f1)1…pmax(ek,fk)k
Example:Product
Let's find the product of 15 and 24
15=31⋅51
24=23⋅31
15×24=23⋅31+1⋅51
360=8⋅9⋅5
Example:Division
lets find the division of 28 by 14
28=22⋅7
14=2⋅7
28/14=22−1⋅71−1
28/14=2
Example: Exponentiation
Lets find 153
15=31⋅51
153=33⋅53
153=27⋅125
153=3375
Example:GCD
Lets find the gcd(72,15)
72=23⋅32
15=31⋅51
gcd(72,15)=20⋅31⋅50
gcd(72,15)=3
Example:LCM
Lets find the lcm(72,15)
lcm(72,15)=23⋅32⋅51
lcm(72,15)=8⋅9⋅5=360

Distribution of Primes
Euclid's theorem, that there are infinitely many primes, is one of the oldest and most attractive in mathematics.
Theorem: There are infinitely many primes
Proof: The proof is by contradiction; we assume that there are only finitely many primes, and then we obtain a contradiction from this, so it follows that there must be infinetly many primes.
Suppose that the only primes are p1,p2,…,pk.Let
m=p1.p2…pk+1
Since m is an integer greater than 1.the fundamental theorem of arithmetic implies that it is divisible by some prime p.( this includes the possibility that m=p).By our assumption , this p must be one of the primes in p1,p2,…pk, so p divides their product p1,p2,….pk. Since p divides both m and p1.p2…,pk, it divides m−p1.p2.….pk=1, which is impossible. We deduce that our initial assumption was false, so there must be infinitely many primes.
Prime Number Theorem
The prime number theorem (PNT) describes the asymptotic distribution of prime numbers among the positive integers. It quantifies the intuitive idea that primes become less common as they become larger. Here are the key points about the prime number theorem:
Statement:The prime number theorem states that for large values of x, the prime-counting function π(x)(which counts the number of primes less than or equal to x) is approximately equal to xln(x)
In other words, as x increases, the probability that a randomly chosen integer not greater than x is prime approaches 1ln(x)
The prime number theorem asserts that:
limx→∞π(x)xln(x)=1
This means that xln(x) is a good approximation for π(x) in terms of the asymptotic distribution of prime numbers.
Note:
There are infinitely many primes of the form 4q+3
If a and b are coprime, then there are infinitely many primes of the form aq+b
Python Code
primality checking
from sympy.ntheory.primetest import isprime
print(isprime(15))
False
print(isprime(11))
True
generate primes in a range [a,b)
from sympy.ntheory.generate import primerange
for i in primerange(1,50):
print(i,end=" ")
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
primes less than a given numberfrom sympy.ntheory.generate import primepi
print(primepi(50))
15
return the n'th prime
from sympy.ntheory import prime
print(prime(5))
11
Comments
Post a Comment