SlideShare a Scribd company logo
1 of 28
Download to read offline
素数⼤大富豪に関する⾃自由研究まとめ
2015.1.19  第359回勉強会
にせい
今⽇日のおはなし
!  素数⼤大富豪とは
!  基本ルール(カードの出し⽅方など)
!  よく使う倍数判定法
!  「素数⼤大富豪で出すことのできる素数」に関する考察
!  具体的に考えてみる
!  プログラムを使って数えてみる
!  「最⼤大の素数」を探してみる
!  まとめと展望
素数⼤大富豪とは
!  2⼈人以上で遊ぶトランプゲーム
!  ゲームの流流れは⼀一般の⼤大富豪と同じ
!  最初に⼿手札を配る(残ったカードは⼭山札として使⽤用)
!  ⼿手札から、前の⼈人が出した数字より⼤大きい数字を出していく
!  無条件で出せるのは素数のみ
!  素数として出した数字が素数でない場合はペナルティがある
!  ⼿手札のカードを組み合わせて数字を作ることができる
カードの出し⽅方
!  2枚以上のカードを組み合わせて出す場合は、カードの数字を
10進法で左から読んで得られる数字として扱う
!  例例
!  場に出ている枚数と同じ枚数を使い、より⼤大きい数字を出す
!  ジョーカーは0〜~13(K)の好きな数字として出すことができる
(41) (109)
グロタンディーク素数切切り
!  通称: グロタンカット
!  ⼀一般の⼤大富豪で⾔言う「8切切り」
!  有名な数学者の逸話に則り、57は素数として出すことができる
(合成数として出すことはできない)
!  57が出た時は、強制的に場を流流し、
それを出したプレイヤーの⼿手番から
ゲームを再開する
特別なルール(1)
合成数の出し⽅方
!  合成数(素数でない数)は、⼿手札にその数の素因数を表現する
カードを全て持っている場合に限り、それらのカードを捨てる
ことにより出すことができる
!  例例:
× × =
素因数の3枚は捨てる
(直接流流す)
場に出すカードは2枚
特別なルール(2)
反則とペナルティ
!  カードを出せないことは反則にはならない              
(パスをするか、⼭山札から1枚引くことができる)
!  反則
!  素数として出したが素数でなかった
!  合成数出しにおける素因数分解の計算間違い
!  ペナルティ
!  出したカードを全て⼿手札に戻し、その枚数だけ更更に⼭山札からカー
ドを引いて⼿手札に加えて次のプレイヤーに⼿手番を移す
よく使う倍数判定法
!  2の倍数 → (⼀一の位が)偶数
!  5の倍数 → ⼀一の位が5または0
!  3の倍数 → 各桁の和が3の倍数
!  3桁の数Aについて
    A = 100a + 10b + c (例例:A=729ならa=7,b=2,c=9)
      = (99+1)a + (9+1)b + c
      = 99a + 9b + a + b + c
      = 3(33a+3b) + a + b + c
  ∴ a + b + cが3の倍数ならAは3の倍数
ところで…
「素数⼤大富豪で出すことのできる素数」って
⼀一体どのくらいあるのだろう?
(参考)⼤大富豪で出すことのできる⼿手
!  1枚ずつ: (1〜~K) + ジョーカー = 14通り
!  同じ数字2枚〜~4枚: 13 × 3 + 1 = 40通り
!  連続する数字3枚: (3,4,5) 〜~ (K, A, 2) = 11通り
!  連続する数字4枚〜~13枚: 10+9+‥+2+1 = 55通り
!  計120通り
!  マークの違いまで考慮に⼊入れると  464通りくらい
(※ローカルルールよって多少変動あり)
1枚のとき
(7個/7通り)
2枚のとき
(38個/39通り)
3枚のとき (338個/350通り)
素数⼤大富豪で出すことのできる素数
!  10〜~Kの存在により、使う枚数が同じでも表現できる桁数は最
⼤大で2倍になる
!  ジョーカー(2枚)を「0」として使うことができることによ
り、表現できる数の幅がさらに広がっている
!  とはいえ、カードの枚数に制限はあるのだから、出せる素数
は限られるのでは?(推測)
!  桁ごとに、何個の数字を出すことができるのか調べてみる
1桁〜~4桁のとき
!  同じ数字が5つ以上(0は3つ以上)重複することはないため、
全ての数を表現することが可能
!  9,999までの素数の個数… 1,229個
!  素数⼤大富豪で出すことができる4桁までの数は 1,229個
5桁〜~6桁のとき
!  1〜~9の数字は、ジョーカーを使えば6つまで使⽤用可
    0を3つ以上使う素数はトランプでは表現不不可(10の形を除く)
!  5桁:40,009、70,001、70,003、70,009、90,001、90,007
!  6桁:100,003など、計203個
!  5〜~6桁の素数は全部で 77,269個
!  素数⼤大富豪で出すことができる6桁までの数は
1,229 + 77,269 – 209 = 78,289 個
7桁のとき
!  「トランプで表現不不可の素数の個数を求める」プログラムを
作成(Rubyを使⽤用)
!  同じ数字をトランプの枚数以上に重複して使⽤用する素数    
… 4,083個
!  7桁の素数は  586,081個
!  素数⼤大富豪で出すことができる7桁までの数は
78,289 + 586,081 – 4,083 = 660,287個
8桁のとき
!  7桁と同様のプログラムを作成
!  同じ数字をトランプの枚数以上に重複して使⽤用する素数    
… 66,932個
!  8桁の素数は  5,096,876個
!  素数⼤大富豪で出すことができる8桁までの素数は
660,287 + 5,096,876 – 66,932 = 5,690,231個
9桁のとき
!  8桁と同様のプログラムを少しアレンジして使⽤用
!  同じ数字をトランプの枚数以上に重複して使⽤用する素数    
… 591,433個
!  9桁の素数は  45,086,079個
!  素数⼤大富豪で出すことができる8桁までの素数は
5,690,231 + 45,086,079 – 591,433 = 50,184,877個
ここまでの成果まとめ
桁数 全ての素数 トランプで表現可能な素数 (累累計)
1 4 4 4
2 21 21 25
3 143 143 168
4 1,061 1,061 1,229
5 8,363 8,357 9,586
6 68,906 68,703 78,289
7 586,081 581,998 660,287
8 5,096,876 5,029,944 5,690,231
9 45,086,079 44,494,646 50,184,877
限界を感じる
!  桁が増えるとプログラムがなかなか終わらなくなっていく…
(9桁で約2時間半)
!  今後も桁が増えればさらに⻑⾧長くなっていくこと間違いなし
!  桁が増えても「作れる数」は                              
思ったより減らない
!  計算⽅方法について再考する必要あり
ゴールを確認する
!  最⼤大の数は  (9+4×2)×4 + 2×2 -1 = 71桁?
!  対戦相⼿手が最⼩小の数1(A)を持っていると仮定すると最⼤大の数は
99,998,888,777,766,665,555,444,433,332,222,131,313,131,313,
121,212,121,111,111,111,101,010,101
!  試しに因数分解してみた
ゴールを確認する
!  最⼤大の数は  (9+4×2)×4 + 2×2 -1 = 71桁?
!  対戦相⼿手が最⼩小の数1(A)を持っていると仮定すると最⼤大の数は
99,998,888,777,766,665,555,444,433,332,222,131,313,131,313,
121,212,121,111,111,111,101,010,101
!  試しに因数分解してみた → 7で割れる
7 × 11 × 13 × 37 ×
2,699,972,696,972,396,942,393,942,093,912,091,457,546,003,000,275,727,545,727,545,727,273
まとめと展望
!  素数⼤大富豪というトランプゲームが熱い
!  ⼀一般の⼤大富豪と同じなのは、ゲームの流流れくらい
!  素数⼤大富豪で出すことができる9桁までの素数は50,184,877個
!  10〜~71桁の素数についても、今後できればいいな
!  その先には合成数が待っている…
おわり。
  
補⾜足資料料
  
表現不不能な素数の個数を求める(8桁)
!  a = 10,000,001とする
!  aが3,5,7,11で割り切切れる場合はその時点で除外
!  aを1桁ごとに分け、10進数表⽰示で使われる数字の個数をそれぞ
れカウントする(変数 zero, two〜~nine)
!  1は11を使えば7つ以上表現可能なので省省略略
!  aを2桁ごとに分け、10,12が含まれる場合は0,2のカウントを減らす
!  zeroが3以上、または [zero + two〜~nineのどれか] が7以上にな
るものについて素数判定を⾏行行い、該当する個数をカウントする
!  a = a + 2 として繰り返す(a = 99,999,999となるまで)
表現不不能な素数の個数を求める(9桁)
!  基本のプログラムは8桁までと同様
!  「1■1■1■1■1」の形をとる素数のみ別途カウントする    
(■= 4〜~9、それぞれ違う数字でも同じ数字でもOK)
!  141414141 ≦ a ≦ 19191919191 の範囲でカウント

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

素数大富豪に関する自由研究まとめ