Upload
elfan-taxista
View
228
Download
0
Embed Size (px)
Citation preview
7/30/2019 Primes Us
http://slidepdf.com/reader/full/primes-us 1/4
P r i m e S u s p e c t
G a r e t h L e y s h o n
1
a n d R i c h a r d G r e e n
2
g j l @ a s t r o n o m y . c a r d i f f . a c . u k , m a t h 0 0 0 1 @ s a b l e . o x . a c . u k
E d i t o r ' s n o t e : a n e m a i l c o n t a i n i n g t h e f o l l o w i n g t e x t w a s s e n t t o G a r e t h , w h o s p e n t s i x
h o u r s s o l v i n g i t w i t h R i c h a r d . G a r e t h , a p r e v i o u s c o n t r i b u t o r t o t h i s m a g a z i n e , w r o t e t h e
s o l u t i o n u p a n d d o n a t e d i t f o r p u b l i c a t i o n .
T h e r e a r e 2 i n t e g e r s n a n d m b e t w e e n 3 a n d 9 8 i n c l u s i v e . M r . S h a s b e e n t o l d
t h e i r s u m a n d M r . P t h e i r p r o d u c t . T h e f o l l o w i n g t r u t h f u l c o n v e r s a t i o n o c c u r s :
P : I d o n ' t k n o w n a n d m .
S : I k n e w y o u d i d n ' t . N e i t h e r d o I .
P : N o w I k n o w t h e m !
S : N o w I d o , t o o !
W h a t a r e t h e v a l u e s o f n a n d m ?
P . S . I r e c k o n y o u ' l l n e e d a c o m p u t e r .
O K , l e t ' s m a k e t h i s s o u n d m a t h e m a t i c a l . L e t a p a i r b e a s e t o f t w o i n t e g e r s m a n d n
s u c h t h a t 2 < m n < 9 9 . L e t u s s a y t h a t a p a i r w h o s e p r o d u c t c a n b e f a c t o r i s e d i n t o a
d i e r e n t p a i r i s r e f a c t o r i s a b l e ( w e c a n a l s o s p e a k o f t h e i r p r o d u c t a s b e i n g a r e f a c t o r i s a b l e
p r o d u c t ) . T o e x p r e s s a n u m b e r a s t h e s u m o f a p a i r i s t o d e c o m p o s e i t .
T h e s e t o f p a i r s i s n i t e , a n d t h e r e f o r e s o i s t h e s e t o f p r o d u c t s a l i t t l e h a n d l e - t u r n i n g
c o u l d p r o d u c e a l i s t o f r e f a c t o r i s a b l e p a i r s ( w h i c h w e ' l l c a l l s e t R ) . A c o m p u t e r c o u l d
p r o d u c e a c o m p l e t e l i s t | b u t R i c h a r d a n d I d i d n ' t u s e t h a t m e t h o d . I ' m n o t s u r e i f t h a t
l i s t w o u l d h e l p y o u , a n y w a y . N o w , t h i n k a b o u t t h e p r o b l e m : : :
S t e p O n e
M r . P s a y s \ I d o n ' t k n o w : : : "
L e t ' s c a l l t h e p r o d u c t P = m n , s o P i s a m e m b e r o f s e t R . T h a t i s , P i s r e f a c t o r i s a b l e .
S t e p T w o
M r . S s a y s \ I d o n ' t k n o w " | s o t h e s u m , S = m + n , c a n n o t b e 6 o r 7 o r 1 9 5 o r 1 9 6 ,
b e c a u s e t h e s e s u m s w o u l d b e u n i q u e l y d e c o m p o s a b l e .
M r . S a l s o s a y s \ I k n o w M r . P d o e s n ' t k n o w " . T h i s m e a n s t h a t a l l t h e d e c o m p o s i t i o n s
o f S m u s t b e r e f a c t o r i s a b l e p a i r s . L e t a n u m b e r w i t h t h e p r o p e r t y t h a t a l l d e c o m p o s i t i o n s
a r e r e f a c t o r i s a b l e p a i r s b e c a l l e d a g r e e n n u m b e r , i n r e c o g n i t i o n o f m y e r s t w h i l e c o l l e a g u e .
T h e s u m S i s a g r e e n n u m b e r .
1
B a . ( K e b l e ) , n o w P h . D . s t u d e n t a t C a r d i , D e p a r t m e n t o f P h y s i c s a n d A s t r o n o m y
2
B a . ( U n i v e r s i t y ) , P h . D . ( W a r w i c k ) , n o w a t t h e M a t h e m a t i c a l I n s t i t u t e , O x f o r d
9
7/30/2019 Primes Us
http://slidepdf.com/reader/full/primes-us 2/4
1 0 T h e I n v a r i a n t , i s s u e 1 5
N o w 7 < S < 1 9 5 . H o w m a n y s u m s w i t h i n t h i s r a n g e h a v e n o n o n - r e f a c t o r i s a b l e
d e c o m p o s i t i o n s ( t h a t i s , h o w m a n y s u m s a r e g r e e n ) ? W e s h a l l w o r k b y a p r o c e s s o f
e l i m i n a t i o n , e l i m i n a t i n g a l l v a l u e s w i t h a t l e a s t o n e u n i q u e ( t h a t i s , n o n - r e f a c t o r i s a b l e )
d e c o m p o s i t i o n .
S m u s t b e l e s s t h a n 1 0 0 . S i n c e 9 7 i s p r i m e , S > 9 9 c a n b e e x p r e s s e d a s 9 7 p l u s s o m e
n u m b e r b e t w e e n 3 a n d 9 8 i n c l u s i v e . I f t h i s w e r e t h e c a s e , o n e o f m a n d n m i g h t b e 9 7 ,
w h i c h g i v e s a u n i q u e l y f a c t o r i s a b l e d e c o m p o s i t i o n , a n d M r . S c o u l d n ' t b e s u r e t h a t P w a s
r e f a c t o r i s a b l e . T h i s e l i m i n a t e s v a l u e s u p t o S = 9 7 + 9 8 , a n d w e ' v e a l r e a d y e l i m i n a t e d
S = 9 8 + 9 8 .
S i m i l a r l y , S m u s t b e l e s s t h a n 5 6 . S i n c e 5 3 i s t h e l o w e s t p r i m e g r e a t e r t h a n 9 8 = 2 = 4 9 ,
a l l S v a l u e s b e t w e e n 5 6 a n d 1 0 0 c a n b e d e c o m p o s e d a s p a i r s c o n t a i n i n g 5 3 , w h i c h a r e
n o t r e f a c t o r i s a b l e . S o 7 < S < 5 6 .
A n y e v e n n u m b e r c a n b e e x p r e s s e d a s a s u m o f t w o p r i m e s , s o i f S w e r e e v e n , M r . S
c o u l d n ' t b e s u r e m a n d n w e r e n ' t b o t h p r i m e . S u p p o s e S i s e v e n , a n d d e c o m p o s e i t t o
a p a i r o f p r i m e s . S i n c e w e h a v e a l r e a d y r e s t r i c t e d S b e l o w 9 8 , b o t h p r i m e s m u s t b e l e s s
t h a n 9 8 | a n d s i n c e S = 4 i s n o t p e r m i t t e d , b o t h p r i m e s m u s t b e o d d , a n d s o g r e a t e r
t h a n o r e q u a l t o 3 . B o t h p r i m e s a r e t h e r e f o r e i n t h e r a n g e 3 { 9 8 a n d a r e a v a l i d , a n d
u n i q u e l y f a c t o r i s a b l e , d e c o m p o s i t i o n . H e n c e t h e r e a r e n o e v e n g r e e n n u m b e r s .
S o S i s o d d , a n d m u s t b e t h e s u m o f a n o d d a n d a n e v e n . B e c a u s e P i s r e f a c t o r i s a b l e ,
i t m u s t h a v e a t l e a s t t h r e e ( n o t n e c c e s s a r i l y d i s t i n c t ) p r i m e f a c t o r s , a n d b e c a u s e o n e o f
m a n d n i s e v e n , 2 m u s t b e a p r i m e f a c t o r o f P .
W e c a n w r i t e a l i s t o f t h e r e m a i n i n g p o s s i b l e v a l u e s o f S , w h i c h w i l l i n c l u d e e v e r y
o d d n u m b e r b e t w e e n 9 a n d 5 5 i n c l u s i v e . A r e t h e y a l l g r e e n ? L e t ' s n o w c o n s t r u c t a n
a l g o r i t h m t o g e n e r a t e e v e r y p o s s i b l e d e c o m p o s i t i o n o f s o m e S , a n d t o r e f a c t o r i s e t h e
d e c o m p o s i t i o n . I f t h e a l g o r i t h m f a i l s f o r t h a t S t h e n t h a t S i s n o t g r e e n .
W e k n o w t h a t w e w a n t a n o d d - e v e n d e c o m p o s i t i o n , w h i c h m u s t b e o f t h e f o r m
S = 2 a + b . N o w 2 a m u s t b e i n t h e r a n g e 4 t o S ; 3 b e c a u s e o f t h e l i m i t s o n 2 a a n d b .
C a n w e a l w a y s r e f a c t o r i s e t h i s t o t h e p a i r a 2 b ?
I f a = b a n d i s p r i m e t h e n t h e r e f a c t o r i s a t i o n i s n o t d i s t i n c t . S o n o S = 2 a + a = 3 a
i s g r e e n . A l l n u m b e r s o f t h e f o r m 3 p r i m e c a n b e s t r u c k o f r o m o u r l i s t o f c a n d i d a t e s .
I f 2 a = 4 a n d b i s p r i m e , t h e p a i r i s n o t r e f a c t o r i s a b l e . S o a n y S w h i c h c a n b e
e x p r e s s e d a s 4 + p r i m e i s n o t g r e e n , a n d c a n b e d e l e t e d f r o m o u r l i s t .
I f b i s n o n - p r i m e ( a n d 2 a i s s t i l l 4 ) , i t m u s t h a v e a t l e a s t o n e p r i m e f a c t o r n o g r e a t e r
t h a n i t s s q u a r e r o o t s i n c e b i s w i t h i n t h e 2 < b < 9 9 r a n g e , t h i s p r i m e f a c t o r i s l e s s
t h a n 1 0 a n d w i l l m u l t i p l y t h e 4 t o a n u m b e r n o g r e a t e r t h a n 4 0 | w e l l w i t h i n r a n g e .
S i n c e b i s a n o d d n o n p r i m e , d i v i d i n g o u t t h i s p r i m e f a c t o r m u s t l e a v e a n o d d r e m a i n d e r ,
h e n c e t h e r e m a i n e r i s a l s o g r e a t e r t h a n 2 a n d m u s t b e i n r a n g e .
S o i f b i s n o n - p r i m e , w e c a n t h e n c o n s i d e r v a l u e s o f 2 a b e t w e e n 6 a n d S ; 3 . F o r t h e
p o s s i b l e v a l u e s o f S , a i s a l w a y s w i t h i n r a n g e . N o w S < 5 7 s o b = ( S ; 2 a ) i s a l w a y s l e s s
t h a n 5 1 . I n f a c t , b , b e i n g o d d , c a n n o t e x c e e d 4 9 a n d s o 2 b c a n n o t e x c e e d 9 8 , a n d t h e
r e f a c t o r i s a t i o n i n t o a 2 b i s v a l i d .
H e n c e t h e g r e e n n u m b e r s a r e a l l o d d n u m b e r s b e t w e e n 7 a n d 5 5 i n c l u s i v e w h i c h a r e
n o t e x p r e s s i b l e a s 3 p r i m e o r 4 + p r i m e .
T h i s l i s t c a n e a s i l y b e c o n s t r u c t e d . W e c a n i d e n t i f y t h e w h o l e s e t o f g r e e n n u m b e r s :
1 3 , 1 9 , 2 5 , 2 9 , 3 1 , 3 7 , 4 3 , 4 9 , 5 3 a n d 5 5 .
L e t a n y p a i r o f n u m b e r s w h o s e s u m i s g r e e n b e s a i d t o b e a g r e e n p a i r ( p a i r s
7/30/2019 Primes Us
http://slidepdf.com/reader/full/primes-us 3/4
P r i m e S u s p e c t 1 1
h a v e m a n y - t o - o n e m a p p i n g s t o b o t h t h e s e t o f g r e e n s u m s a n d t h e s e t o f r e f a c t o r i s a b l e
p r o d u c t s ) .
S t e p T h r e e
M r . P s a y s \ N o w I k n o w ! " P i s a r e f a c t o r i s a b l e n u m b e r o n l y o n e o f w h o s e f a c t o r i s a t i o n s
i s a g r e e n p a i r .
I f a g r e e n p a i r c a n b e r e f a c t o r i s e d t o g i v e a n o t h e r g r e e n p a i r , l e t u s s a y i t i s b r i g h t
g r e e n . I f i t c a n n o t , l e t i t b e p a l e g r e e n . P ' s f a c t o r i s a t i o n i s n e c c e s s a r i l y p a l e g r e e n .
I f a p r o d u c t i s r e f a c t o r i s a b l e , i t c o u l d b e c l a s s i e d a s b e i n g d a r k ( n o g r e e n
f a c t o r i s a t i o n s , a l l t h e f a c t o r i s a t i o n s | o f w h i c h t h e r e m u s t b e a t l e a s t t w o | b e i n g ` g r e y '
p a i r s ,
3
p a l e ( e x a c t l y o n e g r e e n f a c t o r i s a t i o n | a p a l e g r e e n p a i r | a n d a t l e a s t o n e g r e y
f a c t o r i s a t i o n ) , o r b r i g h t ( m o r e t h a n o n e g r e e n f a c t o r i s a t i o n , a l l i n t o b r i g h t g r e e n p a i r s ,
p l u s a n i n d e t e r m i n a t e | z e r o , o n e o r m o r e t h a n o n e | n u m b e r o f g r e y f a c t o r i s a t i o n s ) . N o n -
r e f a c t o r i s a b l e p r o d u c t s h a v e a u n i q u e f a c t o r i s a t i o n w h i c h c a n n o t b e a g r e e n p a i r b y t h e
d e n i t i o n o f g r e e n n e s s .
S t e p F o u r
M r . S s a y s \ N o w I k n o w , t o o ! " S i s a g r e e n n u m b e r o n l y o n e o f w h o s e d e c o m p o s i t i o n s i s
p a l e .
S t e p F i v e
W h a t a r e m a n d n ?
I t t u r n s o u t t h a t t h e s o l u t i o n t o s t e p f o u r i s u n i q u e . A l l b u t o n e o f t h e g r e e n n u m b e r s
a r e m u l t i p l y p a l e , t h a t i s , t h e y h a v e a t l e a s t t w o p a l e d e c o m p o s i t i o n s ( I d o n ' t k n o w e n o u g h
s e t t h e o r y t o k n o w i f t h i s n e c c e s s a r i l y f o l l o w s f r o m t h e a b o v e ) . S o w e c a n g o t h r o u g h o u r
l i s t o f g r e e n n u m b e r s a n d e l i m i n a t e a l l t h o s e w i t h a t l e a s t t w o p a l e d e c o m p o s i t i o n s .
W e c o u l d t a k e e a c h g r e e n c a n d i d a t e a n d c o n s t r u c t p o s s i b l e d e c o m p o s i t i o n s m e t h o d -
i c a l l y : 3 ( S ; 3 ) 4 ( S ; 4 ) 5 ( S ; 5 ) : : : a n d t e s t e v e r y p o s s i b l e r e f a c t o r i s a t i o n o f e a c h
p a i r f o r g r e e n n e s s . W e m u s t t e s t e v e r y p o s s i b l e r e f a c t o r i s a t i o n o f a d e c o m p o s i t i o n t o
m a k e s u r e n o n e o f t h e m i s g r e e n , s o t h a t t h e d e c o m p o s i t i o n i s p a l e , b u t i t i s s u c i e n t t o
n d t w o p a l e d e c o m p o s i t i o n s t o e l i m i n a t e e a c h c a n d i d a t e .
B y w a y o f a s h o r t c u t , w e c o u l d b e c l e v e r a b o u t t h e d e c o m p o s i t i o n s w h i c h w e t e s t , b y
l o o k i n g f o r p r i m e n u m b e r s p .
T e s t ( a ) : I f t h e g r e e n c a n d i d a t e c a n b e e x p r e s s e d a s ( p + 2
z
) t h e n p w i l l b e o d d
a n d z > 2 ( z = 1 i s b e l o w l i m i t s , a n d i f z = 2 t h e p a i r c o u l d n o t b e g r e e n ) . T h e r e
w i l l b e a t l e a s t o n e r e f a c t o r i s a t i o n , t o 2 p a n d 2
z ; 1
, a n d m o r e i f z > 3 . B u t a n y
p o s s i b l e r e f a c t o r i s a t i o n w o u l d b e a n e v e n - e v e n p a i r . S i n c e a l l g r e e n n u m b e r s a r e o d d ,
s u c h a p a i r c a n n o t p o s s i b l y b e g r e e n .
T e s t ( b ) : I f t h e g r e e n c a n d i d a t e c a n b e e x p r e s s e d a s ( 6 + p ) , t h e o n l y p o s s i b l e
r e f a c t o r i s a t i o n i s t o 3 2 p . I f p > 2 6 t h e n t h e s u m o f t h e r e f a c t o r i s a t i o n w i l l b e
t o o l a r g e t o b e g r e e n . O t h e r w i s e t h e r e f a c t o r i s a t i o n m u s t b e t e s t e d b y i n s p e c t i o n .
T e s t ( c ) : I f t h e g r e e n c a n d i d a t e c a n b e e x p r e s s e d a s ( 1 8 + p ) , r e f a c t o r i s a t i o n s t o 3 p 6
a n d 3 6 p c a n n o t g i v e g r e e n p a i r s a s t h e s u m w o u l d b e d i v i s i b l e b y 3 | a n d i t c a n b e
3
I n e n v i r o n m e n t a l j a r g o n , t h e o p p o s i t e o f g r e e n i s g r e y .
7/30/2019 Primes Us
http://slidepdf.com/reader/full/primes-us 4/4
1 2 T h e I n v a r i a n t , i s s u e 1 5
s e e n b y i n s p e c t i o n t h a t n o n e o f t h e g r e e n n u m b e r s i s a m u l t i p l e o f 3 . T h e o n l y o t h e r
r e f a c t o r i s a t i o n i s 9 2 p w h i c h m u s t b e t e s t e d b y i n s p e c t i o n .
L e t ' s a n a l y s e a l l t h e g r e e n n u m b e r s f o r m u l t i p l e p a l e n e s s u s i n g t h e s e t e s t s . A l l t h e
f o l l o w i n g n u m b e r s c a n b e e l i m i n a t e d .
5 5 = 4 7 + 8 ( p a l e b y t e s t ` a ' ) = 3 2 + 2 3 ( p a l e b y t e s t ` a ' )
5 3 = 3 7 + 1 6 ( p a l e b y t e s t ` a ' ) = 6 + 4 7 ( p a l e b y t e s t ` b ' s i n c e 4 7 > 2 6 )
4 9 = 3 2 + 1 7 ( p a l e b y t e s t ` a ' ) = 4 1 + 8 ( p a l e b y t e s t ` a ' )
4 3 = 3 2 + 1 1 ( p a l e b y t e s t ` a ' ) = 6 + 3 7 ( p a l e b y t e s t ` b ' s i n c e 3 7 > 2 6 )
3 7 = 3 2 + 5 ( p a l e b y t e s t ` a ' ) = 2 9 + 8 ( p a l e b y t e s t ` a ' )
3 1 = 2 3 + 8 ( p a l e b y t e s t ` a ' ) = 1 8 + 1 3 ( p a l e b y t e s t ` c ' s i n c e i t r e f a c t o r s t o 9 2 6
w h o s e s u m i s 3 5 , w h i c h i s g r e y )
2 5 = 8 + 1 7 ( p a l e b y t e s t ` a ' ) = 1 8 + 7 ( p a l e b y t e s t ` c ' a s i t r e f a c t o r s t o 9 1 4 a n d
2 3 i s g r e y )
1 9 = 1 6 + 3 ( p a l e b y t e s t ` a ' ) = 1 1 + 8 ( p a l e b y t e s t ` a ' )
1 3 = 8 + 5 ( p a l e b y t e s t ` a ' ) = 6 + 7 ( p a l e b y t e s t ` b ' s i n c e i t r e f a c t o r s t o 3 1 4 a n d
1 7 i s g r e y )
S o t h e s e t h r e e t e s t s a r e s u c i e n t t o p r o v e t h e m u l t i p l e p a l e n e s s o f a l l g r e e n n u m b e r s
o t h e r t h a n 2 9 . T h e y a r e n o t s u c i e n t t o s h o w t h a t 2 9 h a s o n l y o n e p a l e d e c o m p o s i t i o n .
W e m u s t t e s t a l l p o s s i b l e d e c o m p o s i t i o n s o f 2 9 f o r g r e e n r e f a c t o r i s a t i o n s .
D e c o m p o s i t i o n R e f a c t o r i s a t i o n S u m G r e e n ?
3 2 6 6 1 3 1 9 y e s
4 2 5 2 0 5 2 5 y e s
5 2 4 4 0 3 4 3 y e s
6 2 3 4 6 3 4 9 y e s
7 2 2 1 4 1 1 2 5 y e s
8 2 1 2 4 7 3 1 y e s
9 2 0 4 5 4 4 9 y e s
1 0 1 9 3 8 5 4 3 y e s
1 1 1 8 2 2 9 3 1 y e s
1 2 1 7 5 1 4 5 5 y e s
1 3 1 6 ( p a l e b y t e s t ` a ' a b o v e )
1 4 1 5 3 0 7 3 7 y e s
H e n c e , a l o n e a m o n g t h e g r e e n n u m b e r s , 2 9 h a s o n l y o n e p a l e d e c o m p o s i t i o n . T h e v a l u e s
o f m a n d n a r e 1 3 a n d 1 6 . M r . P ' s p r o d u c t i s 2 0 8 . M r . S ' s s u m i s 2 9 . P r o b l e m s o l v e d .
D e s p i t e t h e h i n t t h a t \ y o u w i l l p r o b a b l y n e e d a c o m p u t e r " , i t w a s d o n e i n p r a c t i c e
u s i n g o n l y t w o n e u r a l n e t w o r k s r u n n i n g w e t w a r e a n d a c a l c u l a t o r . T h e s o l u t i o n a b o v e
( g r e a t l y r e n e d b y v i r t u e o f b e i n g u n d e r s t o o d n o w ) c a n b e u n d e r s t o o d w i t h o u t u s e e v e n
o f a c a l c u l a t o r .