Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#51 Re: Help Me ! » How to solve these equations » 2016-12-13 23:08:52

Hi  zetafunc ,

Will  you  please  give  an  example  ? 

Hi  thickhead ,

Once  you  have  got  a  valid  pair  of  i  and  j , then  you  may  add 
n * 182 * 165  to  both  sides  of  182 * i   and  165 * j  and  obtain  a  bunch  of  i  and  j   as  you  had  stated  in  # 3 . While  to  express  a  certain  prime   as   a * 17 +  b * 5   may  need  trial  and  error .

#52 Re: Help Me ! » How to solve these equations » 2016-12-13 16:31:41

Hi  thickhead , 

Your  answer  is  correct  but  the  values  i = 967  and  j = 1061  are  too  large .
I  have  got    an  answer  for  i = 142  and  j = 151 .
By  the  method  you  stated  in  #  3 , I  tried  929 = a * 17 +  b * 5  and  got 
929 = 2 * 17  +  179 * 5  ( by  trial  and  error ) , thus 
929 = 2 * (182 - 165 ) + 179 * ( 10 * 182 - 11 * 165 )
       = 2 * 182 + 179 * 10 * 182  - ( 2 * 165 + 179 * 11 * 165 )
       =  1792 * 182  -  1971 * 165 
Thus  an  answer  is  i = 1792  and  j  =  1971 .
Since  1792 = 10 * 165 + 142   while  1971 = 10 * 182 + 151 ,
thus  929  =  ( 10 * 165 + 142  ) * 182  -  ( 10 *  182 + 151 ) * 165
                = 10 * 165 * 182  +  142 * 182  - ( 10 * 182 * 165  +  151 * 165 )
              =  142 * 182  -  151 * 165 
Thus  another  answer  is  i = 142  and  j  = 151
Your  answer  can  also  be  simplified  as  967 = 5 * 165 + 142  while 
1061 = 5 * 182  + 151  .

#53 Re: Help Me ! » How to solve these equations » 2016-12-12 17:22:17

Hi  zetafunc ,

Thanks  for  your  opinion !

Hi  thickhead  ,

Thanks  much  for  your  reply ! 
Originally  I  wonder  why  I  can't  get  the  6  primes  from  (1)  to  (6)  using  the 
expression  182 * i  -  165 * j  ,  now  I  have  found  that  it's  because  I  omitted 
i  for  53  after  (108)  at  the  algorithm .
As  182 * 53 = 9646   -  165 * 55 = 9075 ⇒ d =  571 (P)  for i=53  and j=55
Let   182 * i  -  165 * j  =  -571      ⇒ 182 ( 53 + i )  -  165 ( 55 + j ) = 0
        ⇒ 182 ( 53 + i )  =165 ( 55 + j )   ⇒ i = 165 - 53 = 112   and  j = 182 - 55 = 127
Thus  the  prime  -571  will  occur  in  its  symmetric  place  with  i = 112  and  j = 127 .

However , the  method  at  shown  in  # 3  seems  not  work  since  i  and  j  should  be 
relatively  prime .

#54 Help Me ! » How to solve these equations » 2016-12-11 17:45:00

mr.wong
Replies: 29

For  equations  of  the  form  182 * i  -  165 * j  = p
where  i  and  j  are  integers  and  p  is  prime  .
( 182 = 2*7*13   while  165 = 3*5*11 . )
i  is  relatively  prime  with  165  and  j  while  j  is  relatively  prime 
with  182  and  i . Solve  i  and  j  for 
(1)  182 * i  -  165 * j  =  89 
(2)  182 * i  -  165 * j  = 241
(3)  182 * i  -  165 * j  = 419
(4)  182 * i  -  165 * j  =  571
(5)  182 * i  -  165 * j  =  929
(6)  182 * i  -  165 * j  =  997

#55 Re: Help Me ! » An algorithm to generate primes » 2016-12-09 15:39:03

Composite  no.  < 1000  containing  at  least  1  prime  factor  from  17  to  31 .(The  other  prime  factor  may  >  31 ,  but  will  <  1000 / 17  =  58 . 8 , i.e.  53 )  ( 27  ones ) :

( A )   Arranged  in  products  of  prime  factors 
  *  |  17    |  19   |  23  |  29  |  31  ||  37  |  41  |  43  |  47  |  53  |
17  |  289  | 323  | 391 | 493 | 527 || 629 | 697 | 731 | 799 | 901 |
19  |    /     | 361  | 437 | 551 | 589 || 703 | 779 | 817 | 893 |   /    |
23  |    /     |   /     | 529 | 667 | 713 || 851 | 943 | 989 |    /   |   /    |
29  |    /     |   /     |   /    | 841 | 899 ||   /    |    /   |   /    |    /   |    /   |
31  |    /     |   /     |    /   |   /    | 961 ||   /    |    /   |   /    |    /   |    /   |



( B )  Rearranged  in  ascending  order 
2xx   :    289
3xx   :   323  ,  361  , 391 
4xx   :   437  , 493 
5xx   :   527  , 529  ,  551  , 589 
6xx   :   629  , 667  , 697 
7xx   :   703  , 713  , 731  , 779  ,  799
8xx   :   817  , 841  , 851  , 893  ,  899 
9xx   :   901  , 943  , 961  , 989

#56 Re: Help Me ! » An algorithm to generate primes » 2016-12-06 20:09:04

Since  the  nos.  generated  are  found  to  be  symmetric  from  (175)  upwards  with  (176)  downwards  . It  can  be  induced  that  the  value  in  ( r )  is 
identical  with  that  in  (351 - r )  by  * ( -1 )  for  r ≧ 7 . E.g. the  values  obtained  in 
(173)  is  239  and  (178)  - 239 .

Similarly  we  can  predict  that  the  value  obtained  in  (7)  , i.e.
182 * 1 - 165 * 1 = 17  will  occur  in  ( 351 - 7 ) = ( 344 )  as  - 17 .

Let  the  expression  in (344)  be  expressed  as  182 i - 165j  = -17 
where  i  is  relatively  prime  with  165 * j   while  j  is  relatively  prime 
with  182 * i .
Since  182i - 165j  =  -17  ⇒ 165 j  -  182i  = 182 - 165
                                           ⇒ 165 j  +  165  =  182 i  + 182 
                                           ⇒ 165 ( j + 1) =  182 ( i + 1)
A  solution  for  the  equation  is  j+1 = i+1 = 0  ⇒ j = -1  and  i = -1 ,
i.e.  the  expression  in (7) : 182 * 1 - 165 * 1 = 17 .

Another  solution  is   i + 1 = 165  and  j + 1 = 182 ,
⇒ i = 164   and  j = 181 .
Thus  the  expression  in  (344)  may  be  expressed  as 
182 * 164 - 165 * 181=   29848 -  29865= -17

A  third  solution  for  the  equation  may  be  i + 1 = 2 * 165 = 330 
and  j+1 = 2 * 182 = 364     ⇒ i = 329  and j = 363 .
i.e.  182 * 329 = 59878  -   165 * 363 =  59895      = -17  .

#57 Re: Help Me ! » An algorithm to generate primes » 2016-12-03 22:20:54

(  Continued  from  #   17  )

(104) 182 * 52 = 9464                          165 * 53 = 8745                           719 (P)
(105) 182 * 52 = 9464                          165 * 55 = 9075                           389 (P)
(106) 182 * 52 = 9464                          165 * 57 = 9405                              59 (P)
(107) 182 * 52 = 9464                          165 * 59 = 9735                        -   271 (P)
(108) 182 * 52 = 9464                          165 * 61 = 10065                       -601(P)
(109) 182 * 56 = 10192                        165 * 57 = 9405                            787  (P)   
(110) 182 * 56 = 10192                        165 * 59 = 9735                            457 (P)
(111) 182 * 56 = 10192                        165 * 61 = 10065                          127 (P)
(112) 182 * 56 = 10192                        165 * 67 = 11055                       -    863 (P)
(113) 182 * 58 = 10556                    165 * 59 = 9735                              821 (P)
(114) 182 * 58 = 10556                    165 * 61 = 10065                           491 (P)
(115) 182 * 58 = 10556                    165 * 67 = 11055                        -   499 (P)
(116) 182 * 58 = 10556                    165 * 69 = 11385                      -   829 (P)
(117) 182 * 59 = 10738                        165 * 61 = 10065                         673 (P)
(118) 182 * 59 = 10738                        165 * 67 = 11055                   -      317  (P)
(119) 182 * 59 = 10738                        165 * 69 = 11385                   -   647 (P)
(120) 182 * 59 = 10738                         165 * 71 =  11715                 -       977 (P)
(121) 182 * 61 = 11102                        165 * 67 = 11055                         47  (P)
(122)  182 * 61 = 11102                        165 * 69 = 11385                -    283 (P) 
(123) 182 * 61 = 11102                        165 * 71 = 11715              -   613 (P)
(124) 182 * 61 = 11102                     165 * 73 =  12045             - 943 ( = 23 * 41 )
(125)  182 * 62 = 11284                     165 * 67 = 11055                         229 (P)
(126) 182 * 62 = 11284                 165 * 69 = 11385                  -  101 (P)
(127) 182 * 62 = 11284                 165 * 71 = 11715                 -   431(P)
(128) 182 * 62 = 11284                 165 * 73 = 12045                -    761(P)
(129) 182 * 64 = 11648                 165 * 67 = 11055                     593 (P)
(130) 182 * 64 = 11648                 165 * 69 = 11385                 263(P)
(131) 182 * 64 = 11648                 165 * 71 = 11715               -   67  (P)             
(132) 182 * 64 = 11648                 165 * 73 = 12045              -    397 (P)
(133) 182 * 64 = 11648                 165 * 75 =  12375             -    727 (P)
(134) 182 * 67 =  12194                165 * 69 = 11385                  809 (P)
(135) 182 * 67 =  12194                165 * 71 = 11715                  479 ( P)
(136) 182 * 67 =  12194                165 * 73 = 12045                  149 (P)
(137) 182 * 67 =  12194                165 * 75 =  12375             -   181 (P)
(138) 182 * 67 =  12194               165 * 79 =  13035             -    841 (= 29 * 29 )
(139) 182 * 68 =  12376                165 * 69 = 11385                  991 (P) 
(140) 182 * 68 =  12376                165 * 71 = 11715                  661 (P)
(141) 182 * 68 =  12376                165 * 73 = 12045                  331 (P)
(142) 182 * 68 =  12376                165 * 75 =  12375                 1
(143) 182 * 68 =  12376                165 * 79 =  13035             -    659 (P)
(144) 182 * 68 =  12376               165 * 81 =  13365            -   989  (=23*43)
(145) 182 * 71 =  12922                 165 * 73 = 12045                877 (P)
(146) 182 * 71 =  12922                 165 * 75 =  12375               547 (P)
(147)  182 * 71 =  12922                 165 * 79 =  13035          -      113 (P)
(148) 182 * 71 =  12922                 165 * 81 =  13365           -        443 (P)
(149 )  182 * 71 =  12922                 165 * 83 = 13695          -      773 (P)
(150)  182 * 73 = 13286                  165 * 75 =  12375               911 (P)
(151)  182 * 73 = 13286                  165 * 79 =  13035                251 (P) 
(152)   182 * 73 = 13286                  165 * 81 =  13365            -       79 (P)
(153)   182 * 73 = 13286                   165 * 83 = 13695            -    409 (P)
(154)  182 * 73 = 13286                   165* 85 = 14025             -    739 (P)
(155) 182 * 74 = 13468                    165 * 79 =  13035                433 (P)
(156) 182 * 74 = 13468                     165 * 81 = 13365                  103 (P)       
(157) 182 * 74 = 13468                    165 * 83 = 13695             -     227 (P) 
(158) 182 * 74 = 13468                    165 * 85 = 14025             -      557 (P)   
(159) 182 * 74 = 13468                    165 * 87 =  14355            -     887 (P)
(160) 182 * 76 = 13832                    165 * 79 =  13035                  797 (P)
(161) 182 * 76 = 13832                    165 * 81 =  13365                     467 (P)
(162) 182 * 76 = 13832                   165 * 83 = 13695                  137 (P)
(163) 182 * 76 = 13832                    165 * 85 = 14025             -      193 (P)
(164) 182 * 76 = 13832                    165 * 87 = 14355             -    523 (P)
(165) 182 * 76 = 13832                    165 * 89 = 14685             -     853 (P)
(166) 182 * 79 = 14378                    165 * 83 = 13695                  683 (P)
(167) 182 * 79 = 14378                    165 * 85 = 14025                   353 (P)
(168) 182 * 79 = 14378                    165 * 87 = 14355                  23 (P)
(169) 182 * 79 = 14378                    165 * 89 = 14685             -     307 (P)
(170) 182 * 79 = 14378                    165 * 93 = 15345             -      967 (P)
(171) 182 * 82 = 14924                    165 * 85 = 14025            899 (= 29 * 31)
(172) 182 * 82 = 14924                    165 * 87 = 14355                   569 (P)
(173) 182 * 82 = 14924                    165 * 89 = 14685                   239 (P)
(174) 182 * 82 = 14924                    165 * 93 = 15345              -     421(P) 
(175) 182 * 82 = 14924                    165 * 95 = 15675              -      751(P)


(176) 182 * 83 = 15106                    165 * 87 = 14355                    751  ( Re)
(177) 182 * 83 = 15106                    165 * 89 = 14685                    421
(178) 182 * 83 = 15106                    165 * 93 = 15345                -    239                 
(179) 182 * 83 = 15106                   165 * 95 = 15675                -    569                   
(180) 182 * 83 = 15106                   165 * 97 = 16005           - 899 (= 29 * 31 )
(181) 182 * 86 = 15652                            165 * 89 = 14685                    967
(182) 182 * 86 = 15652                             165 * 93 = 15345                    307
(183) 182 * 86 = 15652                            165 * 95 = 15675                 -    23
(184) 182 * 86 = 15652                           165 * 97 = 16005                 -   353
(185) 182 * 86 = 15652                            165 * 99 = 16335                -       683
(186) 182 * 89 = 16198                           165 * 93 =  15345                       853 
(187) 182 * 89 = 16198                           165 * 95 = 15675                       523
(188)  182 * 89 = 16198                            165 * 97 = 16005                            193
(189)  182 * 89 = 16198                            165 * 99 = 16335                    -        137
(190)  182 * 89 = 16198                            165 * 101 = 16665                  -        467
(191)  182 * 89 = 16198                            165 * 103 = 16995                 -         797
(192) 182 * 91 = 16562                            165 * 95 = 15675                       887
(193) 182 * 91 = 16562                            165 * 97 = 16005                            557
(194) 182 * 91 = 16562                            165 * 99 = 16335                           227
(195) 182 * 91 = 16562                           165 * 101 = 16665                    -      103
(196) 182 * 91 = 16562                           165 * 103 = 16995              -      433
(197) 182 * 92 = 16744                   165 * 97 = 16005                            739
(198) 182 * 92 = 16744                   165 * 99 = 16335                           409
(199) 182 * 92 = 16744                   165 * 101 = 16665                         79
(200) 182 * 92 = 16744                   165 * 103 = 16995                    -   251
(201)  182 * 92 = 16744                   165 * 107 = 17655                   -   911
(202)  182 * 94 =  17108                   165 * 99 = 16335                           773
(203)  182 * 94 =  17108                   165 * 101 = 16665                         443
(204)  182 * 94 =  17108                      165 * 103 = 16995                    113
(205)  182 * 94 =  17108                          165 * 107 = 17655             -    547       
(206)  182 * 94 =  17108                          165 * 109 = 17985              -    877
(207)  182 * 97 = 17654                  165 * 101 = 16665             989 ( = 23 * 43 )
(208)  182 * 97 = 17654                           165 * 103 = 16995                    659
(209)  182 * 97 = 17654                           165 * 107 = 17655               -  1
(210)  182 * 97 = 17654                           165 * 109 = 17985             -    331
(211)  182 * 97 = 17654                            165 * 111 = 18315            -    661
(212)  182 * 97 = 17654                            165 * 113 = 18645            -    991
(213)  182 * 98 = 17836                    165 * 103 = 16995              841 ( = 29 * 29 )
(214)  182 * 98 = 17836                    165 * 107 = 17655               181
(215)  182 * 98 = 17836                    165 * 109 = 17985           -    149
(216)  182 * 98 = 17836                   165 * 111 = 18315           -     479
(217)  182 * 98 = 17836                   165 * 113 = 18645            -    809
(218)  182 * 101 = 18382                         165 * 107 = 17655               727
(219)    182 * 101 = 18382                         165 * 109 = 17985                 397
(220)    182 * 101 = 18382                         165 * 111 = 18315               67             
(221)   182 * 101 = 18382                         165 * 113 = 18645           -     263           
(222)    182 * 101 = 18382                         165 * 115 =  18975         -        593


The  prime  751  obtained  in  (175 )  repeated  in  ( 176 ) , but  the  former 
= 165 * 95  -  182 * 82   and  the  latter  =  182 * 83  -  165 * 87  ,  while 
          165 * 95  -  182 * 82   =  182 * 83  -  165 * 87 
<=>  165 * 95  +  165 * 87  =  182 * 83 + 182 * 82
<=>   165  * ( 95 + 87 ) =  182 * ( 83 + 82 )
<=>   165 * 182  =  182 * 165   .

It  is  quite  strange  that  then  the  prime  421  obtained  in  (174 )  was 
repeated  in  ( 177 ) by  * -1 ,  and  so  on  for  every  nos .  obtained  before , i.e. ,
the  list  is  symmetric ( for  absolute  value ) upwards  at  (175) and  downwards  at  (176) .
( It  seems  that  if  the  list  is  not  symmetric  at  certain  place  then  there  must 
be  something  wrong . )

#58 Re: Help Me ! » An algorithm to generate primes » 2016-11-28 20:16:24

Numbers  with  value  < 1000  generated  mainly  from  set  of  primes  <  17 .

Let  S  =  { 2 , 3 , 5 , 7 , 11 , 13 }   and  take  A =  { 2 , 7 , 13 }  and  B = { 3 , 5 , 11 }  ,  thus   π A = 182  and   πB = 165   while   L1 = 17 ^2 =  289 .   
Multiply  182  by  i , and  165  by  j  where  i and  j  are   positive  integers  . If  i  is  relatively  prime  with  165  and  j , while  j  is  relatively  prime  with  182  and  i ,  then  182 * i  is  relatively  prime  with  165 * j .   
Let   n  be  182 * i  ± 165 * j   for  various  values  of  i  and  j  , clearly  n  is  not  divisible  by  primes <  17 , nor  every  prime  factors  of  i  and  j  .
If  n  generated  ( as  sum  or  difference ) <  289 , then  n = 1  or  is  a  prime .
If  n > 289 , then  usually  we  have   to  check  further  the  divisibility  of  n  by 
consecutive  primes  from  17  up  to  the  prime  just  <  √n  ( may  be  by  actual  division )  , excluding  those  prime  factors  of  i  or  j  . If  every  such  prime   does  not  divide  n , then  n  is  a  prime .

In  the  following  we  shall  list  all  such  n's  with  value  < 1000 .

( A )  sum 
(1)  182 * 1   +   165 * 1 =  347  ( P )
(2)  182 * 1   +   165 * 3 =  677  ( P )
(3)  182 * 1   +   165 * 5 = 1007
(4)  182 * 2   +   165 * 1 = 529   ( =  23 * 23 )
(5)  182 * 2    +   165 * 3 = 859  ( P )
(6)  182 * 4    +   165 * 1 = 893  ( =  19 * 47 )


( B )  difference 
(7)  182 * 1 = 182        -                    165 * 1 = 165              =                   17 ( P ) 
(8)  182 * 1 = 182        -                    165 * 3 = 495              =                 -313 ( P )
(9)  182 * 1 = 182         -                   165 * 5 = 825              =               - 643 (P)
(10) 182 * 2 = 364          -                  165 * 1 = 165              =        199  (P)             
(11) 182 * 2 = 364         -                   165 * 3 = 495               =                -131  (P)
(12) 182 * 2 = 364         -                   165 * 5 = 825               =               -461  (P)
(13) 182 * 4 = 728         -                   165 * 1 = 165              =                 563 ( P)
(14) 182 * 4 = 728        -                    165 * 3 = 495              =                 233 ( P )
(15)  182 * 4 = 728       -                     165 * 5 = 825             =                  -97  ( P )
(16)  182 * 4 = 728      -                      165 * 9 = 1485           =               - 757 ( P )
(17) 182 * 7 = 1274     -                     165 * 3 = 495              =        779 ( = 19 * 41)
(18) 182 * 7 = 1274     -                      165 * 5 = 825            =                   449 ( P )
(19) 182 * 7 = 1274     -                     165 * 9 = 1485            =                - 211( P )
(20) 182 * 7 = 1274     -                     165 *11 = 1815          =                 -  541(P)
(21) 182 * 8 = 1456    -                      165 * 3 = 495             =          961( = 31 * 31)
(22) 182 * 8 = 1456    -                      165 * 5 = 825             =                  631 ( P )
(23) 182 * 8 = 1456    -                      165 * 9 = 1485           =                 - 29 ( P)
(24) 182 * 8 = 1456    -                      165 *11 = 1815          =                - 359 (P)
(25) 182 * 13 = 2366  -                     165 * 9 = 1485           =                  881 (P)
(26) 182 * 13 = 2366   -                     165 *11 = 1815         =           551( = 19 * 29)
(27)  182 * 13 = 2366       -               165 * 15 = 2475          =                 - 109 (P)
(28) 182 * 13 = 2366        -               165 * 17 = 2805          =                 -  439(P)
(29) 182 * 13 = 2366        -               165 * 19 = 3135          =               -   769(P)
(30) 182 * 14 = 2548        -              165 *11 = 1815            =                 733(P)
(31) 182 * 14 = 2548        -              165 * 15 = 2475          =                 -  73(P) 
(32) 182 * 14 = 2548       -               165 * 17 = 2805          =               -   257(P) 
(33) 182 * 14 = 2548       -               165 * 19 = 3135          =               -   587(P)
(34) 182 * 16 = 2912       -                  165 * 15 = 2475       =            437(=19 * 23)
(35) 182 * 16 = 2912      -                    165 *17 = 2805       =             107(P)
(36)  182 * 16 = 2912     -                     165 * 19 = 3135     =             - 223(P)
(37) 182 * 16 = 2912        -                   165 * 23 = 3795     =           -   883(P)
(38) 182 * 17 = 3094       -                   165 * 15 = 2475      =               619(P)
(39) 182 * 17 = 3094       -                  165 * 19 = 3135       =              -   41(P)
(40) 182 * 17 = 3094      -                     165 * 23 = 3795     =                    701(P)
(41) 182 * 19 = 3458      -                    165 * 15 = 2475      =                 983 (P)
(42) 182 * 19 = 3458      -                    165 *17 = 2805       =                   653(P)
(43) 182 * 19 = 3458      -                   165 * 23 = 3795        =                -   337(P)
(44) 182 * 19 = 3458      -                   165 * 25 = 4125       =      -  667 ( = 23 * 29)
(45) 182 * 23 = 4186     -                     165 * 25 = 4125       =                    61  (P)     
(46) 182 * 23 = 4186     -                     165 * 27 = 4455       =                 -   269(P)
(47) 182 * 23 = 4186     -                     165 *29 = 4785        =                -    599(P)
(48) 182 * 26 = 4732     -                     165 * 23 = 3795       =                      937(P)
(49) 182 * 26 = 4732     -                     165 * 25 = 4125       =                      607(P)
(50) 182 * 26 = 4732     -                     165 * 27 = 4455       =                      277(P)
(51) 182 * 26 = 4732    -                    165 * 29 = 4785        =                 -   53(P)   
(52) 182 * 26 = 4732    -                    165 * 31 = 5115        =                     - 383(P)
(53) 182 * 26 = 4732    -                   165 * 33 = 3795      =        713 ( =  23 * 31 )
(54) 182 * 28 = 5096    -                      165 * 25 = 4125      =                        971 (P)
(55) 182 * 28 = 5096    -                      165 * 27 = 4455      =                        641 (P)
(56) 182 * 28 = 5096    -                      165 * 29 = 4785      =                        311 (P)
(57)182 * 28 = 5096    -                       165 * 31 = 5115      =                     -    19 (P)
(58)182 * 28 = 5096    -                       165 * 33 = 5445     =                      -  349 (P)
(59) 182 * 29 = 5278   -                       165 * 27 = 4455     =                          823 (P)
(60) 182 * 29 = 5278   -                       165 * 31 = 5115    =                         163 (P)
(61)182 * 29 = 5278       -                   165 * 33 = 5445       =                    -  167 (P)
(62)182 * 29 = 5278      -                    165 * 37 = 6105       =                    -  827 (P)
(63) 182 * 31 = 5642     -                     165 * 29 = 4785      =                         857 (P)
(64) 182 * 31 = 5642     -                     165 * 33 = 5445      =                         197 (P)
(65) 182 * 31 = 5642     -                     165 * 37 = 6105      =                    -   463 (P)
(66) 182 * 32 = 5824     -                     165 * 31 = 5115      =                        709 (P)
(67) 182 * 32 = 5824     -                     165 * 33 = 5445     =                          379 (P)
(68) 182 * 32 = 5824     -                     165 * 37 = 6105      =                    -   281 (P)
(69) 182 * 32 = 5824     -                     165 * 41 = 6765      =                  -    941 (P)
(70)182 * 34= 6188      -                     165 * 33 = 5445       =                        743 (P)
(71)182 * 34= 6188      -                     165 * 37 = 6105       =                        83 (P)
(72)182 * 34= 6188      -                     165 * 41 = 6765       =                   -   577 (P)
(73)182 * 34= 6188     -                      165 * 43 = 7095       =                    -   907 (P)
(74) 182 * 37 = 6734     -                     165 *  41 = 6765     =                 -    31 (P) 
(75) 182 * 37 = 6734    -               165 * 43 = 7095            =        - 361 ( = 19 * 19 )
(76) 182 * 37 = 6734    -                   165 * 45 = 7425        =                   -   691 (P)
(77) 182 * 38 = 6916    -                      165 * 37 = 6105     =                         811 (P)
(78) 182 * 38 = 6916    -                      165 * 41 = 6765     =                         151 (P)
(79) 182 * 38 = 6916    -                      165 * 43 = 7095    =                     -   179 (P)
(80) 182 * 38 = 6916    -                      165 * 45 = 7425     =                    -    509 (P)
(81) 182 * 38 = 6916    -                      165 * 47 = 7755     =                    -    839 (P)
(82) 182 * 41 = 7462    -                      165 * 43 = 7095     =                        367 (P)
(83) 182 * 41 = 7462    -                      165 * 45 = 7425     =                            37 (P)
(84) 182 * 41 = 7462   -                       165 * 47 = 7755    =                       -  293 (P)
(85) 182 * 41 = 7462   -                       165 * 51 = 8415     =                     -  953 (P)
(86) 182 * 43 = 7826   -                       165 * 45 = 7425     =                  401 (P)     
(87) 182 * 43 = 7826    -                      165 * 47 = 7755      =                       - 71 (P)
(88) 182 * 43 = 7826    -                      165 * 51 = 8415     =       - 589 ( = 19 * 31 )
(89) 182 * 43 = 7826     -                     165 * 53 = 8745     =                    -    919 (P)
(90) 182 * 46 = 8372    -                      165 * 45 = 7425    =                          947 (P)
(91) 182 * 46 = 8372     -                     165 * 47 = 7755     =                         617 (P)
(92) 182 * 46 = 8372    -                   165 * 51 = 8415        =           -43 (P)
(93) 182 * 46 = 8372    -                   165 * 53 = 8745         =                   -  373 (P)
(94) 182 * 46 = 8372     -               165 * 55 = 9075            =      - 703 ( = 19 * 37 )
(95) 182 * 47 = 8554     -                  165 * 51 = 8415        =                       139 (P)
(96) 182 * 47 = 8554     -                  165 * 53 = 8745        =                      - 191 (P)
(97) 182 * 47 = 8554     -                  165 * 55 = 9075       =                    -    521 (P)
(98) 182 * 47 = 8554     -                 165 * 57 = 9405        =        - 851 ( = 23 * 37 )
(99) 182 * 49 = 8918    -                  165 * 51 = 8415        =                       503 (P)
(100)182 * 49 = 8918   -                  165 * 53 = 8745        =                       173 (P)
(101)182 * 49 = 8918   -                      165 * 55 = 9075    =                      -  157(P)
(102)182 * 49 = 8918   -                 165 * 57 = 9405         =                     - 487 (P)
(103)182 * 49 = 8918   -              165 * 59 = 9735            =        - 817 ( = 19 * 43 )


( To  be  continued )

It  should  be  better  to  list  the  real  values  of  their  difference 
instead  of  the  absolute  values  of  their  difference .

#59 Re: Help Me ! » An algorithm to generate primes » 2016-11-23 16:02:12

( X )  Summary  :

If  a , b  and  c  are  relatively  prime  ,  then 

( 1 )  a ± b  is  not  divisible  by  a  or  b  .
       (  2  incomplete  groups  ) 

( 2 )   ab ± 1  is  not  divisible  by  a  or  b .
        ( 1  complete  group  with  1  void  group . )

( 3 )  ab  ± a  ± b  is  not  divisible  by  a  or  b  .
        (  1  complete  group  with  2  incomplete  groups . ) 

( 4 )  ab  ±  ac ± bc  is  not  divisible  by  a , b  or  c  .
        (  3  incomplete  groups . ) 

( 5 )  abc  ±  ab  ± ac ±  bc   is  not  divisible  by  a , b  or  c .
         (  1  complete  group  with  3  incomplete  groups . )

Defects  of  this  algorithm  : 

The  limitation  is  usually  not  large  enough  compared  with the  n's  so  generated  .  If  we  want  to  generate  bigger  primes , the  no.  of  basic  primes  needed  should  be  more  thus  the  limitation  will  become  greater  .  But  it  is  not  easy  to  distribute  the  basic  primes  into  ,  say  2  incomplete  groups  so  that  the  n's  generated  will  be  smaller  than  the  limitation .
In  the  following  we  shall  demonstrate  an  example  how  to  arrange  the  basic  primes  for  2  incomplete  groups  .

Let  S =  { 2 , 3 , 5 , 7 , 11 , 13 }  be  split  into  2  groups  A  and  B .     Thus  L1 = 17 ^2 =  289 
and  L2 = 17 * 19 = 323 .

Take  A =  { 2 , 7 , 13 }  and  B = { 3 , 5 , 11 }  ,  thus   π A = 182  and   πB = 165 

(1)  n1= 182 - 165 = 17 (P)
(2)  Add  2  to  A   i.e.   A1 = { 2 , 2 , 7 , 13 }  thus    π A1 =  2 *182 = 364 
      and  get  n2 = π A1 - πB = 364 - 165 = 199 (P)
(3)  Add  3  to  B  i.e.  B1 =  { 9 , 5 , 11 }  thus  πB1 = 3 *165  = 495
     and  get  n3 = πB1 - π A  = 495 - 182 = 313 (P) 
(4)  Get  n4 = πB1 - π A1 = 495 - 364 = 131 (P)
(5)  Add  4  to  A  and  5  to  B , thus  π A2 = 4 * 182  = 728  while  πB2 = 5 * 165  = 825 
      and  get  n5 = 825 - 728 = 97 (P)
(6)  Get  n6 = 4 * 182 -  3 * 165 = 728 - 495 = 233 (P)
(7)  Add  7  to  A  and  9  to  B ,  thus  7 * π A = 7 * 182 = 1274   while  9 * 165 = 1485
      and  get  n7 = 1485 - 1274 = 211 (P)
(8) Add  8  to  A  and  9  to  B , thus  8 * 182 = 1456  , and  get  n8 = 1485 - 1456 = 29 (P)
(9) Add  13  to  A  and  15  to  B , thus  13 * 182 = 2366  while  15 * 165 = 2475 
     and  get  n9 = 2475 - 2366 = 109 (P)
(10) Add  14  to  A  and  15  to  B , thus  14 * 182 = 2548  , and  get  n10 = 2548 - 2475 = 73 (P)
(11) Add   14  to  A  and  17  to  B , ( notice  that  L1  will  become  19 ^2 = 361 and  L2  will  become 
        19 * 23 = 437   )  thus  17 * 165 = 2805 ,  and  get  n11 = 2805 - 2548 = 257 (P) 
(12) Add  14  to  A  and  19  to  B ,  thus  14 * 182 = 2548  while  19 * 165 = 3135 , and  get
         n12 = 3135 - 2548 = 587  .   By  actual  division  we  find  that  587  is  not  divisible  by  17 .
          Thus  L1  becomes  23 ^2 = 529  and  L2  becomes  23 * 29 = 667 .   Therefore  529  is  a      prime .
(13) Add  16  to  A  and  17  to  B     , thus  16 *182 = 2912   and  17 * 165 = 2805 , and  get 
        n13 =  2912 - 2805 = 107 (P) 
(14) Add  16  to  A  and  19  to  B , thus  16 * 182 = 2912  and  19 * 165 = 3135 , and  get 
        n14 = 3135 - 2912 = 223 (P) 
(15) Add   17  to  A  and  19  to  B , ( then  L1  becomes  23 ^2 = 529  and  L2  becomes  23 * 29 = 667 )
        thus  17 * 182 = 3094  while  19 * 165 = 3135  , and  get  n15 = 3135 - 3094 = 41 (P) 
(16)  Add  19  to  A  and  23  to  B ,   thus  19 * 182 = 3458  and  23 * 165 = 3795
         and  get  n16 = 3795 -3458 = 337 . Since  337  is  not  divisible  by  17 , therefore  337  is  a  prime .
(17)  Add  23  to  A  and  25  to  B  , thus  23 * 182 = 4186  while  25 * 165 = 4125 
         and  get  n17 = 4186 - 4125 = 61 (P)
(18)  Add  26  to  A  and  27  to  B ,  thus  26 * 182 = 4732  and  27 * 165 = 4455 ,
        and  get  n18 = 4732 - 4455 = 277 (P)
(19)  Add  28  to  A  and  29  to  B , thus  28 * 182 = 5096  while  29 * 165 = 4785 ,
        and  get   n19 = 5096  - 4785 = 311 (P)
(20) Add  28  to  A  and  31  to  B , thus  28 * 182 = 5096  while  31 * 165 = 5115 ,
        and  get  n 20 =  5115 - 5096 = 19  (P)
(21)  Add  29  to  A  and  31  to  B , thus  29 * 182 = 5278  while  31 * 165 = 5115 ,
        and  get  n21 = 5278 - 5115 = 163 (P)
(22)  Add  31  to  A  and  33  to  B , thus  31 * 182 = 5642  while  33 * 165 = 5445 ,
        and  get  n22 = 5642 - 5445 = 197 (P)

Summary  in  Table

    A={2 ,7 ,13} , π A = 182  ;        B={3 ,5 ,11}  ,πB = 165  ;     difference    ;    L1 = 289  ; L2 = 323
(1)       182 * 1 = 182                           165 * 1 = 165                     17 
(2)        182 * 1 = 182                           165 * 3 = 495                     313
(3)        182 * 2 = 364                           165 * 1 = 165                     199
(4)        182 * 2 = 364                           165 * 3 = 495                     131 
(5)        182 * 4 = 728                            165 * 5 = 825                     97 
(6)        182 * 4 = 728                            165 * 3 = 495                    233
(7)        182 * 7 = 1274                          165 * 9 = 1485                 211
(8)        182 * 8 = 1456                          165 * 9 = 1485                  29
(9)       182 * 13 = 2366                         165 * 15 = 2475               109
(10)     182 * 14 = 2548                         165 * 15 = 2475                73 
(11)     182 * 14 = 2548                         165 * 17 = 2805               257 
(12)     182 * 14 = 2548                         165 * 19 = 3135               587   
(13)     182 * 16 = 2912                         165 * 17 = 2805               107
(14)     182 * 16 = 2912                         165 * 19 = 3135               223
(15)     182 * 17 = 3094                         165 * 19 = 3135               41
(16)     182 * 19 = 3458                         165 * 23 = 3795               337
(17)     182 * 23 = 4186                         165 * 25 = 4125               61
(18)     182 * 26 = 4732                         165 * 27 = 4455               277
(19)     182 * 28 = 5096                         165 * 29 = 4785               311
(20)     182 * 28 = 5096                         165 * 31 = 5115                19
(21)     182 * 29 = 5278                         165 * 31 = 5115               163
(22)     182 * 31 = 564                           165 * 33 = 5445               197
(23)     182 * 32 = 582                           165 * 33 = 5445               379
(24)     182 * 34= 6188                          165 * 33 = 5445               743
(25)     182 * 52 = 9464                         165 * 55 = 9075               389 
(26)     182 * 56 = 10192                       165 * 57 = 9405               787     
(27)     182 * 101 = 18382                     165 * 109 = 17985            397
(28)     182 * 97 = 17654                       165 * 103 = 16995            659

#60 Re: Help Me ! » An algorithm to generate primes » 2016-11-19 16:43:31

(iii)  Set  of  primes  without  " 2 "  and  " 5 "  for  3  incomplete  groups 

If  the  set  S  used  to  generate  primes  does  not  contain  2  and  5 
as  its  elements  while  3  incomplete  groups  are  involved . Then  the 
combined  sum  or  difference  of  them  is  not  divisible  by  2  but  may 
be  divisible  by  5  .

Example 
Let  S  =  { 3 , 7 , 11 , 13 }  ,  then  L1 = 17 ^2 = 289  ;  L2 = 17 * 19 =  323  ;
and  L3 = 23 ^2 =  529 . 
Take  A =  {[ 3 , 7 ] ,    11 ,       /   }  ,  thus  π A =  231
Take  B = {[ 3 , 7 ] ,     /    ,   13 }  ,  thus   π B = 273
Take  C = {     /    ,   11  ,    13 }  ,   thus  π C = 143

n1 = 231 + 273 + 143 =  647 (  √ 647 = 25.4 )  then  we  have  to  check  whether  647  is  divisible  by  17 , 19  or  23  . As  647 - 323 = 324 ,   thus  647 = 2 * 17 * 19 + 1 
so  647  is  not  divisible  by  17  nor  19 . Also  647 - 529 = 118 = 2 * 59 
so  647  is  not  divisible  by  23 , therefore  647  is  a  prime .

n2 = 231 + 273 - 143 = 361 = 323 + 38  = 323 + 2 * 19   ,  thus  361  is    divisible 
        by  19 .
n3  = 231 - 273 + 143 = 101  ( p )
n4  = -231 + 273 + 143 = 185  while  185 / 5 = 37 ( p )

#61 Re: Help Me ! » An algorithm to generate primes » 2016-11-17 17:01:59

(ii)  Set  of  primes  without  " 2 "  for  3  incomplete  groups 

If  the  set  S  used  to  generate  primes  does  not  contained   2  as  its  element   
with  3  ( or  any  odd  nos. > 3 )  incomplete  groups  are  involved . Then  the 
product  of  each  group  will  all  be  odd , thus  the  combined  sum  or  difference 
of  them  will  also  be  odd , i.e. , not  divisible  by  2 .

Example 
Let  S  =  { 3 , 5 , 7 , 11 }  ,  thus  L1 = 13^2 = 169  ,  L2 = 13*17 = 221  and  L3 = 19 ^2 = 361
Take  A =  { [ 3 , 5] , 7 , / } ,  B =  { [ 3 , 5] ,  /  , 11 }  and  C =  {  /  ,  7  ,  11 }
Thus  π A = 105  ,  π B =  165  ,  π C = 77 ,
n1 = 105 + 165 + 77 = 347 ( p )  since  347 - 221 = 126 = 2 * 9 * 7
n2 = 105 + 165 -  77 = 193 ( p )
n3 = 105 -  165 + 77 =  17  ( p )
n4 =  - 105 + 165 + 77 = 137 ( p ) 

If  complete  groups  are  joined  to  participate  in  addition  or  subtraction  with  the  incomplete  groups , more  n's  can  be  generated . We  may  add  in  an  even  no.  of  complete  groups ,  or  choose  1  complete  group  with  an  additional   element  of  2 . 
For  example , let  T =  { 2 , 3 , 5 , 7 , 11 }  ,  thus  π T = 2310

Take  A2 = { 9 , 25 , 7 }  ,  thus π A2 = 1575   while  B  and  C  remain  unchanged .
n5 = 2310 - 1575 - 165 - 77 = 493  , while  493 - 221 = 272 = 4 * 68 = 4 * 4 * 17 , thus  493  contains  17  as  a  factor .
n6 = 2310 - 1575 - 165 + 77 = 647  ( √ 647 = 25.4 ) , thus  we  have  to  check  whether  647  is  divisible    by  13 , 17 , 19  or  23 .  As   647 - 13 * 17 = 426 = 6 * 71  , thus  647  is  not  divisible  by  13 nor 17 . 
  Also  19 * 23 =  437  while  647 - 437 = 210 ( does  not  contain  19  nor  23  as  factor )  , therefore    647  is  a  prime .

#62 Re: Help Me ! » An algorithm to generate primes » 2016-11-15 16:15:43

( IX )  Miscellaneous  examples 

( i )  Set  of  primes  used  without  " 5 "

If  the  set  S  used  to  generate  primes  does  not  contained   5  as  its  element  ,  then  the  n's  generated  may  be  divisible  by  5 .  If  this  happens  it  can  be  easily  inspected  for  the  n's  so  generated  will  end  in  5 . We  just  exclude  all  factors  of  5  by  dividing  n  by  5  and  get  the  quotient  .

Example 
Let  S  =  {  2 , 3 , 7 , 11 }   thus  L1 = 13 ^2 = 169  ;  L2 = 13 * 17  =  221 
Take   A1 =  {  2 , 11 }  and  B1 =  { 3 , 7 } 
Therefore   π A1 =  22  ,  πB1 =  21 
n1 =  22 +  21 =  43  ( p ) ,
n2 =  22 -  21 = 1

Take  A2 = { 4 , 11 }  ,  thus  π A2 = 44 ,
n3 =  π A2 +  πB1  =  44 +  21  =  65  while  65 / 5 = 13 ( p )
n4 =  π A2  -  πB1 =  44 -  21  =  23  ( p )

Take  B2 = { 9 , 7 }  , thus   π B2 =  63 ,
n5 =  π A1 +   π B2 = 22 + 63 = 85  while  85 / 5  = 17 ( p )
n6 =  π A1 -  π B2 =  22 -  63  = - 41 ( p ) 

n7 = π A2 +  πB2  = 44 + 63 = 107 ( p )
n8 = π A2  -  πB2  = 44 -  63 = - 19 ( p )

#63 Re: Help Me ! » An algorithm to generate primes » 2016-11-12 15:35:20

( VIII )  Primes  stored  in  compartments 

In  section ( VII )  it  can  be  seen  that  there  is  no  restriction  for  the  no.  of 
complete  groups . For  incomplete  groups  it  seems  that  the  total  no.  should  be 
r   . However , if  originally  the  primes  of  S  are  stored  in  so-called  compartments 
inside  S  where  certain  compartments  contain  > 1  distinct  primes (  with  various  exponents ) , 
then  the  total  no.  of  incomplete  groups  can  be  reduced .

For  example , let  S = { 2 , 3 , 5 , 7 , 11 , 13 , 17 }  -----  totally  7  distinct  primes . Thus  L1 = 19^2 = 361 ,L2 = 19 * 23 = 437  and  L3 = 29^2 = 841 .
If  the  primes  are  stored  in  say  3  compartments  like  :
{ [ 2,3,5] , [ 7,11] , [ 13,17 ] } ;
then  we  may  take   G1 =  {  [ 2^2 ,3,5,] ,  [ 7,11] ,       /       }  = { 60 , 77 ,  1 } ,
thus   π G1 =  4620
                                G2 =  { [ 2^2,3,5,] ,       /        ,  [ 13,17 ]} =  { 60 , 1 , 221} ,
thus  π G2 = 13260 
                                G3 =  {     /             ,   [7,11] ,      [ 13,17 ]}  = { 1 , 77 , 221 } ,
thus  π  G3 = 17017
We  may  get  n1 =  π G1  + π G1 - π  G3
                           =  4620 + 13260 - 17017
                           =  863
Since  √ 863 = 29.3  thus  for  863  to  be  composite , it  must  contain  prime  factor  ≦ 29 . 
As  863 - 841 ( L 3 ) = 22 = 2 * 11 ⇒  863 = 29 * 29 + 2 * 11 , thus  863  is  not  divisible  by  29 ;
Also  863 - 437 ( L2 ) = 426 = 2 * 213  = 2 * 3 * 71  ⇒ 863 = 19 * 23 + 2*3*71 , thus  863  is  not  divisible  by  19  nor  23 , since  863  is  already  not  divisible  by  any  prime ≦ 17 , therefore  863  is  a  prime .

#64 Re: Help Me ! » An algorithm to generate primes » 2016-11-10 15:05:01

( VII )  Incomplete  groups  and  complete  groups 


In  section  ( VI )  we  have  generated  primes  with  r  groups  each  containing   r-1  primes
taken  from  the  set  S . These  groups  will  be  referred  as  " incomplete  groups " .
In  fact  other  groups  which  contain  all  the  r  primes   (  referred  as  " complete  groups ")  may  also  participate   to  generate  primes  with  those  incomplete  groups . The  result  after    combined  sum  or  difference  of  them  is  still  not  divisible  by  every  prime  contained  in  S  after  the  joining  of  complete  groups .

Example 

As  in  the  table  shown  in  section  ( VI )  , if  the  set  S  being  itself  considered  as  a 
complete  group  ,  with  π S = 2*3*5 = 30  ,  join  the  operations  of  addition  or 
subtraction  with  the  3  incomplete  groups  G1 , G2  and  G3 , 
then  we  may  get  n1 = 30 + 6 + 10 + 15 = 61 ( p )  since  61 <  77 ( L2 ) .
Also  n2 =  30 + 6 + 10 - 15 = 31  ( p )
         n3 =  30 + 6  + ( -10 ) + 15 = 41 ( p )
         n4 =  30 +( -6 ) + 10  + 15 =  49  ( = L1 )
         n5 =  - 30  + 6  +  10  +  15  =  1
         n6 =  30 + 6 - 10 - 15 = 11 (p)
         n7 =  30  - 6  + 10 - 15 =  19  ( p )
         n8 =  30  - 6  - 10  + 15 = 29  ( p )

#65 Re: Help Me ! » An algorithm to generate primes » 2016-11-08 15:11:30

( VI )  To  generate  primes  with  more  than  2  groups 

Instead  of  partition  S  , a  set  with  r  primes  ( r ≧ 3 ) into  2  groups  only  ,
we  may  form  r  groups ( denoted  by  G )  of  primes  from  S  ,  such  that   each 
group  contains  exactly  r -1  primes  taken  from  S  , i.e. , each  prime  will  not  exist 
in  one  and  only  one  group .

Let  π G  denotes  the  product  of  primes  ( each   with  exponents  ≧ 1 )
contained  in  each  G  . If  we  take  the  combined  sum  or  difference  of  every  π G  ,
the  value  n  obtained  will  not  be  divisible  by  any  prime  contained  in  S .
If  n  <  L , the  limitation  then  n  will  be  prime  or  =  1  .

Examples 

( I )  Let  S = { 2 , 3 , 5 }  , thus  L1 = 49  and  L2 = 77 .

( 1 )  Take  G1 =  { 2 , 3 } , G2 = { 2 , 5 }  and  G3 = { 3 , 5 } ,
  Thus  G1  lacks  the  prime  5 , G2  lacks  3  and  G3  lacks  2
  as  shown  in  the  following  table .

    S |  2  ,  3  ,  5  |
   G1|  2  ,  3  ,  /   | -----  π G1 =  6 
   G2|  2  ,  /   ,  5  | -----  π G2 = 10 
   G3|   /  ,  3  ,  5  | -----  π G3 = 15

Then  n1 =  6 + 10 + 15 = 31 ( p ) 
          n2 =  6 + 10 - 15 = 1
          n3 =  6 -  10  + 15 = 11 ( p ) 
  and  n4 =  -6  + 10  + 15  = 19 (p)

It  seems  more  primes  can  be  generated  in  this  way .

#66 Re: Help Me ! » An algorithm to generate primes » 2016-11-06 22:29:04

( V )  The  ultimate  limitation   L3   

After  the  extension  of  limitation from   L1  to  L2 , the  chance  of  the  number  generated 
to  be  a  prime  becomes  greater . Now  we  try  to  extend  the  limitation  a  bit  further .
If  a  number  n  generated  >  L2  , i.e.  [ P(n+1) * P(n+2) ] ,  but <  [P ( n + 3 )] ^2  (  denoted  by  L3 ) , then  n  will  be  prime  if  n  is  not  divisible  by  both  P (n+1)  and  P (n+2) .

To  find  whether  n  is  divisible  by  P (n+1)  and  P (n+2)  or  not  , we  can  divide  n  by 
P (n+1)  and  P( n+2)  one  by  one , or  once  with  the  following  method .
  Let  k = n -  P(n+1) * P(n+2)  ⇒  n = P(n+1) * P(n+2) + k  , then  factorize  k .
If  k  does  not  contain  either  P(n+1)  or  P(n+2)  as  factor , then  n  also ,
thus  n  is  a  prime  . Otherwise  n  will  be  composite  .

Examples

Let  S  =  { 2 , 3 , 5 , 7 }  and  divided  into  S  and  {  } .
Then  L1 = 11 ^2 = 121 ;    L2 = 11 * 13 = 143    and  L3 = 17 ^2 =  289  ,
πS = 210  and  π {  } = 1  .
Then  n1 = 210 +1 = 211  ,  211 >  143  but  <  289   thus  we  test  whether  211  is  divisible 
by  11  or  13 .

Since  211 -  143 = 68   ⇒    211 = 143 + 68
                                                      =  11 * 13  +  4 * 17
Thus   68  then  211  is  not  factorable   by  11  or  13  (  also  not  by  17 ) ,
therefore  211  is  a  prime .

For  n2 = 210 - 1 =  209  , also  >  143  but  <  289 .
Since  209 - 143 = 66  ⇒    209 = 143 +  66
                                                    = 11 * 13  +  6 *  11 ,
therefore  209  contains  11  as   a  factor  ,  thus  is  a  composite  .


L3  or  P ( n + 3 ) ^2  ,  will  be  referred  as  the  ultimate  limitation .

#67 Re: Help Me ! » An algorithm to generate primes » 2016-11-05 15:26:40

( IV )  To  generate  twin  primes 

If  the  difference  of  2  primes  =  2  ,  then  they  are  called " twin  primes " .
We  may  use  the  algorithm  under  certain  arrangement  to  generate  twin 
primes .

( i )  For  a  set  S  containing   primes  , if  we  divide  it  into  A , being 
S  itself  and  B , being  a  void  set , then  π B  will  be  1 .  Thus
n1 = π A  + 1   and  n2 =  π A  - 1   , i.e.  n1 - n2 = 2 .
If  both  n1  and  n2  are  primes , then  they  are  twin  primes .

Examples 

( 1 )  Let  S = { 2 , 3 , 5 }  , thus  limitation = 7 ^ 2 = 49  and  L2 = 77
Then  π S = 30   and  π {  } = 1 ,
n1 = 30 + 1 = 31  and  n2 = 30 - 1 = 29 ,
Since  both  31  and  29  < 49 ,
Thus  they are  twin  primes .

( 2 )  Let  S = { 2^2 , 3 , 5 } ,
  Then  π S = 60   and  π {  } = 1 ,
n1 = 60 + 1 = 61  and  n2 = 60 - 1 = 59 ,
Though  both  61 and  59  > 49 , but  since < 77 ,
Therefore  they  are  also  twin  primes .


( ii ) For  2  sets  S1  and  S2   such  that   S1  contains  2  and 
other  primes  as   elements  while  S2  contains  2^2 = 4  and  the 
same  rest  primes  as  elements  .   

Example 

Let  S1 =  { 2 , 3 , 5 , 7 }   and  divided  into  A =  { 2 }  and
B = { 3 , 5 , 7 } 
while  S2  =  { 4 , 3 , 5 , 7 }  and  divided  into  A =  { 4 }  and 
B = { 3 , 5 , 7 }  .
Then  Limitation  = 11^2 = 121  for  both  cases .

For  S1 , πA = 2  and  πB = 105  , thus  n1 = 105 + 2 = 107 
  and  n2 = 105 - 2 = 103 .
While  for S2 , πA = 4  and  πB = 105  , thus  n1 = 105 + 4  =  109
and    n2 = 105 - 4 = 101 .

The  difference  of  both  n1  = 2 , and  the  difference  of  both  n2 
also = 2 .  Since  all  the  4  n's  < 121 , thus  they  are  all  primes .
So  2  pairs  of  twin  primes  have  been  generated .

#68 Re: Help Me ! » An algorithm to generate primes » 2016-11-04 14:14:11

( III )  Extension  of  limitation  from   [ P(n+1)] ^2   to  P(n+1) *  P(n+2)     

When  the  no.  of  primes  contained  in  S  increases  , the 
values  of  π A  and  π B  also  increase . The  values  of  n1  and  n2 ,
their  sum  and  difference  , will  frequently  be  greater  then   [ P(n+1)] ^2  ,
the  limitation .  ( Though  the  limitation  will  also  increase . )

To  make  the  algorithm  more  usable , we  extend  the  limitation  from 
[ P(n+1)] ^2  to  P(n+1) *  P(n+2)  , where  P(n+2)  is  the  prime  no.
just  greater  than  P(n+1) .  Since  the  composite  no . just  greater  than 
[ P(n+1)] ^2  and  not  divisible  by  primes ≦ Pn  is   P(n+1) * P(n+2)  .
If  n1  or  n2  so generated ,  though  >   P(n+1)] ^2 ,
but  <   P(n+1) * P(n+2)  ,  then  it  is  still  a  prime .


Example

Let  S = { 2^2, 3^3 , 5^2 } , then  limitation L1 = 7^2 = 49 ,   
      extended  limitation  L2 = 7 * 11 = 77 . 

(1)  Take  A = { 2^2 , 5^2 }  and  B = ( 3^3 }
  thus  πA = 100  and  π B = 27 .
  Then  n2 = 100 - 27 = 73 . Since  73 > 49  but  <  77 , therefore 
73  is  a  prime .

(2) Take  A = { 2^2 , 3^3 }  and  B = { 5^2 } , thus
      πA = 4 * 27 =  108   and  π B = 25 .
Then  n2 = 108 - 25 = 83 > 77 .  We  are  not  sure  whether
83  is  a  prime  or  not .


By  extending  the  limitation  we  have  more  chance  to  generate 
more  primes .

#69 Re: Help Me ! » An algorithm to generate primes » 2016-11-03 14:55:09

( II ) Primes  with  exponents  >  1


In  fact  the  primes  contained  in  S  are  not  necessarily  distinct  .
Each  prime  may  repeat  any  times  , but  when  divided  into  2  groups 
every  same  prime  should  be  put  into  the  same  group . Thus  the  products 
of  elements  of  the  2  groups  are  still  relatively  prime .
If  there  are  n  no.  of  a  certain  prime  Pr  in  a  group  , they  may  be 
denoted  concisely  as  ( Pr ) ^ n  .

Example 

Let  S = { 2 , 3 ,3 ,3 , 5 , 5 } , limitation  is  still  49 .

(1)  Take  A =  { 2 , 3 ,3 , 3}  and  B =  { 5 , 5} ,
  then  A  may  also  be  denoted  by  {  2 , 3 ^ 3 } , while  B  by  { 5 ^ 2 }
thus  πA = 2 * 27 =  54   and  π B = 25 .
Then  n1 = 54 + 25 = 79 . Since  79 > 49 , we  are  not  sure 
whether  it  is  a  prime  or  not .
  n2 =  54 - 25 = 29  ( p )   

(2)  Take  A = { 2 , 5^2 }  and  B = ( 3 ^3 }
thus  πA = 50  and  π B = 27
Then  n1 = 50 + 27 = 77  ( > 49 )
         n2 =  50 - 27 =  23  ( p )

When  the  exponents  of  various  primes  may  take  values  > 1 ,
we  can  generate  more  primes  with  the  same  set  of  distinct 
primes .

#70 Re: Help Me ! » An algorithm to generate primes » 2016-11-03 14:53:33

Hi  bobbym ,

No , it  is  not  the  case .

#71 Re: Help Me ! » An algorithm to generate primes » 2016-11-02 20:51:18

Hi  bobbym ,

I  need  help  to  improve  this  algorithm  latter !

#72 Help Me ! » An algorithm to generate primes » 2016-11-02 17:11:44

mr.wong
Replies: 33

( I )  Principle 

Certain  years  ago  I  had  also  developed  an  algorithm  to  generate 
primes  from  existing  ones . The  principle  is  not  complicated . 

Let  S  denotes  a  set  of  distinct  consecutive  primes  starting 
from  2 , 3  and  onwards  up  to  a  certain  prime  Pn . If  we 
divide  S  into  2  parts  A  and  B  in  any  way  , and  let  π A 
denotes  the  product  of  primes  contained  in  A  ,
while   π B  denotes  the  product  of  primes  contained  in 
B . Thus   π A  and  π B  are  relatively  prime . ( If  one  of 
the  2  subsets  of  S , say  A  is  a  void  set  , then  π A  will  be 
defined  to  be  1 . ) 

Let  n1  denotes   π A  + π B   and  n2  denotes  | π A  - π B | .
It  is  clear  that  both  n1  and  n2  are  not  divisable  by  any 
of  the  primes   ≦ Pn .  n1  or  n2   may  be  prime , composit  ( with  all 
prime  factors  >  Pn  ) , or  =  1 . ( Only  for  n2 .)
Let  P (n+1)  denotes  the  prime  no.  just  >  Pn ,  if  n1  or  n2  <  P (n+1) ^ 2 , 
then  n1 or  n2  must  be  prime  since  the  smallest  composit  no. with  prime 
factors  all  >  Pn  will  be [ P (n+1)] ^ 2 .  The  value  of  P (n+1) ^ 2   will   be 
referred  as  the  limitation .

Examples  :

( I )  Let  S = { 2 , 3 , 5 }  , thus  limitation = 7 ^ 2 = 49 .

(1)  Take  A = { 2 , 3 }  and  B = { 5 }  , thus   πA = 6  and  π B = 5 .
Then  n1 = 6 + 5 = 11 ( prime  since  11 < 49 )
        n2 = 6 - 5 = 1 

(2)  Take  A =  { 2 , 5 }  and  B = { 3 }  , thus  π A = 10  .
Then  n1 = 10 + 3 = 13  ( prime )
         n2 =  10 - 3 =  7  ( p ) 

(3) Take  A =  { 2 }  and  B =  { 3 , 5 }  , thus  π B = 15 .
Then  n1 =  2 + 15  = 17  ( p ) 
          n2 = 15 - 2  =  13  ( p ) 

The  prime  no.  so  generated  will  not  necessarily  be  distinct  , as  we  have 
13 =  10 + 3  = 15 - 2  .

#73 Re: Help Me ! » Probability ---- consecutive individuals » 2016-10-31 20:20:39

It  may  be  ambiguous  to  define  what  is   half - sized  for  a 
matrix ( no matter  a  square  matrix  or  a  triangular  semi-matrix )   
with  n  dots  at  each  side . ( Assuming  that  the  distance  between 
the  dots  are  fixed  and  the  dimension  of  the  dots  may  be  neglected . ) 
For  n  to  be  even , readily  half - sized  means   the  one  with  n / 2   dots .
But  for  n  to  be  odd , quite  probably  we  shall  mean  a  sub - matrix 
with  [ n/2 ] + 1  = ( n + 1 ) / 2  dots  to  be  half - sized  so  that  its  length 
between  the  end  points  will  be  1/2  of  that  of  the  big  one .
For  example  for  a  matrix  with  3  dots  at  each  side  , a  half - sized 
sub - matrix  will  be  referred  to  one  with  2  dots  at  each  side .

#74 Re: Help Me ! » Probability ---- consecutive individuals » 2016-10-29 16:05:33

Thanks  thickhead  ,

Now  it  seems   if  the  no.  of  points  of  the  big  triangle  with  the  2  half - sized 
small  triangles  trend  to  ∞ , then  the  probability  will  trend  to  1/10  .

#75 Re: Help Me ! » Probability ---- consecutive individuals » 2016-10-28 23:02:21

Hi  thickhead ,

Have  you  omitted  a " 25 " at  the  5th row   ,  a  " 25"  at  the 
6th  row  and  a  " 16 " at the  7th  row  in  the  table  at  #  41 ?
Also  for  the  probability  should  the  denominator  be   55*21*21  ?

Board footer

Powered by FluxBB