Prime Numbers By Brian Stonelake What’s a Prime Number? • Lots of definitions out there • My Favorite (recursive): – “an integer greater than.

Download Report

Transcript Prime Numbers By Brian Stonelake What’s a Prime Number? • Lots of definitions out there • My Favorite (recursive): – “an integer greater than.

Prime Numbers
By Brian Stonelake
What’s a Prime Number?
• Lots of definitions out there
• My Favorite (recursive):
– “an integer greater than 1, that is not divisible by
any smaller primes”
• Note: The above is equivalent to (but feels less
restrictive than) the more standard:
– “a positive integer greater than 1 that is not
divisible by any number other than 1 and itself.”
Why Care about Primes?
• Textbook Answer: Fundamental Theorem of
Arithmetic
Every positive integer can be written uniquely
as an increasing product of powers of primes
- So primes are the “DNA” of integers.
• Better(?) Answer: Because they’re there!
How many?
• One of the most famous mathematical proofs
shows that there are infinitely many.
– Ancient Greek Mathematician Euclid
– c. 300 BC
– From “Elements”
– By contradiction
• In a sense, we haven’t made much progress in
the 2300 years since this proof.
Prime producing function?
2 )
(
f (n) = 2 +1are prime.
n
•
In 1641, Fermat stated that all numbers of the form
Called Fermat primes.
– f(0) = 3. Prime.
– f(1) = 5. Prime.
– f(2) = 17. Prime.
– f(3) = 257. Prime.
– f(4) = 65,537. Prime.
• Convinced?
– Roughly 100 years later, Euler showed that f(5)= 4,294,967,297 = 641 x
6,700,417. Composite!
• Today f(4) is still the largest known Fermat prime
– We know Fermat numbers from 5 to 32 are composite
• Those are big numbers. f(9) > # atoms in universe!
– We know f(2,747,497) is composite (largest known Fermat composite)
– We don’t know if there are any more Fermat primes
• We don’t know that there aren’t infinitely many Fermat primes
• We don’t know if there are infinitely many Fermat composites
Prime producing function?
•
Leonard Euler (1770) noted that many numbers of the form e(n) = n 2 - n + 41 are
prime.
–
–
–
–
–
–
•
e(1) = 41. Prime.
e(2) = 43. Prime.
e(3) = 47. Prime.
e(4) = 53. Prime.
e(5) = 61. Prime.
e(6) = 71. Prime.
Convinced?
– e(7), e(8), e(9), e(10), e(11), e(12), e(13), e(14), e(15), e(16), e(17), e(18), e(19), e(20), e(21),
e(22), e(23), e(24), e(25), e(26), e(27), e(28), e(29), e(30), e(31), e(32), e(33), e(34), e(35),
e(36), e(37), e(38), e(39), e(40) all prime.
•
Convinced?
– e(41) = 41*41 - 41 + 41 = 41 (41 - 1 + 1) = 41 x 41. Composite!
•
Can show that no polynomial function can produce only primes.
– Interestingly, any linear function (of the from an + b) produces infinitely many primes, if a and
b are themselves prime.
Prime producing function
• In short, we don’t know of one.
– In 1947 Mills proved that
prime, for some A.
3n ) ú
(
ê
is always
m(n) = A
êë
úû
• Unfortunately we don’t know what A is
• We don’t even know if A is rational or irrational
• Not aesthetically pleasing to use floor function
• Bottom line is that we don’t know of any
prime producing function
– but we know there is one
– Hopefully a prettier one than the above
Mersenne primes
• Marin Mersenne, a French Monk born in 1588
• The nth Mersenne number is m(n) = 2n -1
• Several Mersenne numbers are prime m(2)=3, m(3)=7,
etc.
– m(5), m(7), also prime
– m(composite) = composite
– Mathematicians once thought m(prime)=prime
• Wrong!
• Mersenne numbers have algebraic properties that are
useful in determining primality
– Difference of squares, for example
(
)(
)
• M(100) composite as 2100 -1 = 250 +1 250 -1
Largest known prime
• A game that will never end
– Some think that size of largest prime is a good measure of
society’s knowledge
• Implies exponential growth of knowledge
• Lots of early claims of large primes
– Many were wrong
– Euler (1772) proved m(31) = 2 31 -1 = 2,147, 483,647 prime
– In 1876 m(127) shown to be prime
• Record lasted until 1951
• Largest ever without computers (39 digits)
– M(67) removed from list in 1903 in famous hour long
“talk”
• M(67) =147,573,952,589,676,412,927 = 193,707,721 x
761,838,257,287
Largest known primes
Largest known primes
Random?
• Primes appear to be scattered at random.
– No (known) way to generate them
– No (known) way to (easily) tell if a number is
prime
– So are they scattered randomly?
– Is there a pattern that we’re not smart enough to
see?
• Yes
– Hypothesized by Brian Stonelake (2013)
First 100 primes
But base 10 is arbitrary.
Less Arbitrary Visual Representations
Less Arbitrary Visual Representations
Ulam’s Spiral
Random “white noise”
Less Arbitrary Visual Representations
Archimedean Spiral
Less Arbitrary Visual Representations
Sack’s Spiral: Uses Archimedean Spiral
Less Arbitrary Visual Representations
Less Arbitrary Visual Representations
- Variant of Sach’s
Spiral
- Dot size determined
by unique prime
factors
How little we know
• Prime numbers, the DNA of all numbers, are
remarkably mysterious.
– We can’t generate them
– We don’t have a method for recognizing them
– They don’t appear random, but we can’t describe
their pattern
• What can we say about them?
Distribution of Primes
Less than
Number of primes
Probability of a prime
10
4
40%
100
25
25%
1,000
168
17%
10,000
1,229
12%
100,000
9,592
9.6%
1,000,000
78,489
7.9%
1,000,000,000
50,847,534
5.1%
1,000,000,000,000
37,609,912,018
3.8%
1,000,000,000,000,000
29,844,570,422,669
3.0%
Probability seems to be decreasing. Is there some sort of pattern?
Distribution of Primes
Prime number theorem (PNT)
• PNT says that primes become less common
among large numbers, and do so in a
predictable fashion.
• Approximates the number of primes less than
n as L(n) = n/ln(n).
– The nth prime number is approximately n*ln(n)
• Also says that
primes less than n.
n
1
dx
ln x
2
Li(n) = ò
is an approximation of
– This approximation is closer, sooner.
Prime Number Theorem
n
π(n)
L(n)
Li(n)
π(n) / L(n)
π(n) / Li(n)
10
4
4.3
6.2
0.92103
0.64516
100
25
22
30
1.15129
0.83056
1,000
168
145
178
1.16050
0.94382
10,000
1,229
1,086
1,246
1.13195
0.98636
100,000
9,592
8,686
9,630
1.10432
0.99605
10^6
78,498
72,382
78,628
1.08449
0.99835
10^7
664,579
620,421
664,918
1.07117
0.99949
10^8
5,761,455
5,428,681
5,762,209
1.06130
0.99987
10^9
50,847,534
48,254,942
50,849,235
1.05373
0.99997
10^10
455,052,511
434,294,482
455,055,615
1.04780
0.99999
10^11
4,118,054,813
3,948,131,654
4,118,066,401
1.04304
1.00000
10^12
37,607,912,018
36,191,206,825
37,607,950,281
1.03915
1.00000
10^13
346,065,536,839
334,072,678,387
346,065,645,810
1.03590
1.00000
10^14
3,204,941,750,802
3,102,103,442,166
3,204,942,065,692
1.03315
1.00000
10^15
29,844,570,422,669
28,952,965,460,217
29,844,571,475,288
1.03079
1.00000
10^16
279,238,341,033,925
271,434,051,189,532
279,238,344,248,557
1.02875
1.00000
10^17
2,623,557,157,654,230
2,554,673,422,960,300
2,623,557,165,610,820
1.02696
1.00000
Prime number theorem
We can formally show the intuitive result that primes are less common
among larger numbers
A giant’s walk to infinity
• PNT says large numbers are less likely to be prime
– Intuitively, there are more primes that could divide it
– So primes get more and more “spread out”
• Imagine walking on a number line, where only
primes are steps
– How far could you get?
• I can jump 5 units, where do I get stuck?
– How far would I need to be able to jump to get to
100?
– Could anyone get to infinity?
Prime Gaps
• The difference between two consecutive primes is called the prime gap.
The first few prime gaps are 1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, …
– PNT suggests prime gaps get larger
– But there’s infinitely many primes
– Largest prime gap?
• We can create arbitrarily large prime gaps, by following the following
example
– Prime gap of g = 14
• Multiply all primes less than or equal to g+2. Call that product b.
– b = 2 x 3 x 5 x 7 x 11 x 13 = 30,030
– 30,032 to 30,046 can’t contain any primes
– Note there’s also no primes between 113 and 127
• So we can (easily) find sequences of arbitrarily length that contain no
primes at all!
• Even a giant can’t get to infinity!
Twin primes
• 2 and 3 are the only primes with gap 1
• Many have gap 2; called twin primes
– (3,5), (5,7), (11,13), (17,19), (29,31), (41,43), (59,61),
(71,73), (101,103), (107,109), (137,139)
• Infinitely many?
– Nobody knows (called Twin Prime Conjecture)
• Dates back to at least 1849
• In March 2013, Zhang showed that there are infinitely many
prime “brothers” with gap of some (unknown) number less
than 7 million
• In July the gap bound was reduced to 5,414
• Most believe TPC true
Convergent/Divergent
• Harmonic series diverges
• Squares2 of Harmonic series converges
p
– To
6
– Called Basel Problem (1644), solved by… Euler
• What about reciprocals of primes?
– Are they “frequent enough” to diverge?
• Yes (Euler)
• Shocking?
• What about reciprocals of twin primes?
– They converge (to Brun’s constant)
• We don’t know the constant, it’s very close to 1.830484424658
Gaussian Primes
• Extending the concept of “prime” to complex
numbers
• Gaussian integers are complex numbers of the
form a+bi where a and b are integers
– 2+i is Gaussian prime because no two (non-trivial)
Gaussian integers have 2+i as their product
– Note 5 not Gaussian prime as (2+i)(2-i) = 5
• a+bi Gaussian prime if and only if:
– a = 0 and b is prime and b º 3(mod 4 )
– b = 0 and a is prime and a º 3(mod 4 )
– a 2 + b 2 is prime
Gaussian Primes
Gaussian Primes
Gaussian Primes
• Is there a giant that could walk on Gaussian primes to
infinity?
– Nobody knows
– Best we can do is say that a giant that can’t jump 6
couldn’t do it!
– We know there are “moats” of arbitrary size around
Gaussian primes, but that doesn’t help
• Infinitely many?
– Yes. In fact, Infinitely many that are ordinary primes.
• Largest known (absolute value) is (1+ i )1,203,793 -1
– Real and imaginary parts have 181,189 digits!
– Mersenne-ish
Goldbach Conjecture
Considers sums of primes
• Every even integer greater than 2 can be
expressed as the sum of two primes.
– One of the oldest unsolved problems in math
• Proposed (to Euler) in 1742
– True for all even integers up to
4,000,000,000,000,000,000
– Generally thought to be true, but who knows?
• Is it possible that it’s true but unprovable?
– An author offered $1,000,000 prize for proof or
counterexample in 2002
Goldbach Conjecture
Goldbach Conjecture
Number of ways two primes sum to each even integer up to 1,000
Goldbach Conjecture
Number of ways two primes sum to each even integer up to 1,000,000
Riemann Hypothesis (RH)
• Considered by most the ¥most important problem in math
• Zeta function is z (x) = å n = 1 + 1 + 1 + ...
1 2 3
• RH says that the (non-trivial) zeros of the Zeta function
all have real part ½.
-x
x
x
x
n=1
– Known to be true for the first 10,000,000,000,000 zeros
• If RH is true, there are TONS of implications.
– A major one tells us Li(x) is the best approximation of
prime distribution, and gives error bounds on it.
– Minor ones:
• Reduces Skewes number from 10^10^10^963 to 10^10^10^34
• “A” in Mills prime producing function is approximately
1.306377883863080690486144926…