Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

大きな数の素因数分解がしたいっ!!! #日曜数学会 in 札幌

1,278 views

Published on

2016年2月21日に開催の 第1回日曜数学会 in 札幌 で発表したスライドです。
「二次ふるい法」を用いて、大きな数の素因数分解をするための方法について紹介しました。

第1回日曜数学会 in 札幌:
https://www.facebook.com/events/1728707524032747/

ソースコード(Ruby):
mpqs.rb
https://gist.github.com/junpeitsuji/5b515578941a23686953
以下のソースも組み合わせて使います(gauss_mod.rb)
https://gist.github.com/junpeitsuji/b371dce4b402e550085c

Published in: Education
  • Be the first to comment

大きな数の素因数分解がしたいっ!!! #日曜数学会 in 札幌

  1. 1. @tsujimotter
  2. 2. 391961320150251294647
  3. 3. Simple is best!!!
  4. 4. 391961320150251294647 / 2 = 391961320150251294647 / 3 = 391961320150251294647 / 5 = 391961320150251294647 / 7 = 391961320150251294647 / 11 = …
  5. 5. 391961320150251294647 / 2 = 391961320150251294647 / 3 = 391961320150251294647 / 5 = 391961320150251294647 / 7 = 391961320150251294647 / 11 = …
  6. 6. Quadratic Sieve
  7. 7. X2 – Y2 n (X – Y), (X – Y) n n X2 – Y2 = (X – Y)(X + Y)
  8. 8. X2 – Y2 = n ∴ X2 – n = Y2
  9. 9. X X2 – Y2 = n ∴ X2 – n = Y2 X2 – n = ( )
  10. 10. n = 112373 X2 – n = ( ) 3362 – 112373 = 5231 3372 – 112373 = 22 x 131 x 231 3382 – 112373 = 18711
  11. 11. n = 112373 X2 – n = ( ) 3362 – 112373 = 5231 3372 – 112373 = 22 x 131 x 231 3382 – 112373 = 18711
  12. 12. # 2 3372 – 112373 = 22 x 131 x 231   # 4 3392 – 112373 = 22 x 72 x 131 # 18 3532 – 112373 = 22 x 71 x 191 x 231 # 84 4172 – 112373 = 22 x 71 x 133 #112 4452 – 112373 = 22 x 72 x 191 x 231
  13. 13. # 2 3372 – 112373 = 22 x 131 x 231   # 4 3392 – 112373 = 22 x 72 x 131 # 18 3532 – 112373 = 22 x 71 x 191 x 231 # 84 4172 – 112373 = 22 x 71 x 133 #112 4452 – 112373 = 22 x 72 x 191 x 231 = 28 x 76 x 134 x 192 x 232 =(24 x 73 x 132 x 191 x 23)2 = 4053052642
  14. 14. x1 2 – n = p1p2 x2 2 – n = p2p3 x3 2 – n = p1 p3 (x1 2–n) (x2 2–n) (x3 2–n) = (p1 2p2 2p3 2) (x1x2x3)2 + n ( ) = (p1p2p3)2 Y2 X2
  15. 15. x1 2 – n = p1p2 x2 2 – n = p2p3 x3 2 – n = p1 p3 (x1 2–n) (x2 2–n) (x3 2–n) = (p1 2p2 2p3 2) (x1x2x3)2 + n ( ) = (p1p2p3)2 Y2 X2
  16. 16. x1 2 – n = p1p2 x2 2 – n = p2p3 x3 2 – n = p1 p3 (x1 2–n) (x2 2–n) (x3 2–n) = (p1 2p2 2p3 2) (x1x2x3)2 + n ( ) = (p1p2p3)2 Y2 X2
  17. 17. x1 2 – n = p1p2 x2 2 – n = p2p3 x3 2 – n = p1 p3 (x1 2–n) (x2 2–n) (x3 2–n) = (p1 2p2 2p3 2) (x1x2x3)2 + n ( ) = (p1p2p3)2 X2 Y2
  18. 18. x1 2 – n = p1p2 x2 2 – n = p2p3 x3 2 – n = p1 p3 (x1 2–n) (x2 2–n) (x3 2–n) = (p1 2p2 2p3 2) (x1x2x3)2 + n ( ) = (p1p2p3)2 X2 Y2 X2 – Y2 = n ( )
  19. 19. 222060068552 – 4053052642 = 112373 ( ) (22206006855 – 405305264) x (22206006855 + 405305264) 21800701591 x 22611312119 = = n
  20. 20. 222060068552 – 4053052642 = 112373 ( ) (22206006855 – 405305264) x (22206006855 + 405305264) 21800701591 x 22611312119 = = n
  21. 21. 222060068552 – 4053052642 = 112373 ( ) (22206006855 – 405305264) x (22206006855 + 405305264) 21800701591 x 22611312119 = = 112373
  22. 22. 21800701591 112373 21800701591 = 194003 x 112373 + 2472 112373 = 45 x 2472 + 1133 2472 = 2 x 1133 + 206 1133 = 5 x 206 + 103
  23. 23. 21800701591 112373 21800701591 = 194003 x 112373 + 2472 112373 = 45 x 2472 + 1133 2472 = 2 x 1133 + 206 1133 = 5 x 206 + 103
  24. 24. 21800701591 112373 21800701591 = 194003 x 112373 + 2472 112373 = 45 x 2472 + 1133 2472 = 2 x 1133 + 206 1133 = 5 x 206 + 103
  25. 25. 21800701591 112373 21800701591 = 194003 x 112373 + 2472 112373 = 45 x 2472 + 1133 2472 = 2 x 1133 + 206 1133 = 5 x 206 + 103
  26. 26. 112373 103
  27. 27. p-1
  28. 28. 391961320150251294647
  29. 29. 391961320150251294647 = 182521213001 x 2147483647
  30. 30. Script is here! GitHub Gist https://gist.github.com/junpeitsuji/ 5b515578941a23686953
  31. 31. x2 - n = kp ✓ n p ◆ = 1 p X X2 – n = ( )
  32. 32. n = 15347 X2 – n = ( ) 1242 – 15347 = 291 1252 – 15347 = 21 x 1391 1262 – 15347 = 232
  33. 33. 1262 – 232 = 15347 (126 - 23)(126 + 23) = 15347 103 x 149 = 15347

×