The Niamh prime

A bit of maths-y fiddling around on a Sunday afternoon.

Fascinating video on the Trinity Hall prime at Numberphile:

Apparently, Professor James McKee found a prime number which, when written out as ASCII art, looks like the crest of Trinity Hall college. Jack Hodkinson at Cambridge then searched for and found a prime which looks like a picture of Corpus Christi college (via Futility Closet). That seems like a cool idea. So, with a bit of help from aalib in JavaScript and the Miller-Rabin primality test, plus a bit of scaling images up and down in Gimp, I found this 2,850-digit prime:

777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,577,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­777,777,777,­752,385,356,­867,777,777,­777,777,777,­777,777,777,­777,777,777,­775,352,235,­666,688,668,­667,777,777,­777,777,777,­777,777,777,­777,776,765,­555,556,666,­856,868,667,­777,777,777,­777,777,777,­777,777,777,­222,335,666,­666,866,686,­666,665,777,­777,777,777,­777,777,777,­777,355,336,­358,866,556,­666,655,665,­655,777,777,­777,777,777,­777,777,733,­552,236,666,­666,655,665,­665,666,555,­777,777,777,­777,777,777,­777,276,265,­666,666,656,­655,555,555,­555,533,777,­777,777,777,­777,777,253,­252,566,666,­665,555,556,­555,555,565,­557,777,777,­777,777,777,­725,222,236,­666,565,555,­555,556,555,­535,355,237,­777,777,777,­777,772,266,­725,366,535,­555,355,555,­555,553,553,­533,577,777,­777,777,777,­272,637,356,­655,555,555,­353,535,556,­655,355,332,­277,777,777,­777,772,235,­775,355,665,­553,355,353,­535,533,555,­555,223,777,­777,777,777,­322,222,255,­555,556,353,­555,355,336,­355,653,533,­537,777,777,­777,772,222,­225,555,565,­555,355,335,­355,356,555,­655,353,237,­777,777,777,­772,272,355,­553,553,355,­535,353,365,­355,355,553,­523,577,777,­777,777,332,­333,566,333,­553,555,533,­355,355,555,­555,353,555,­677,777,777,­777,332,355,­555,555,555,­555,555,553,­555,535,555,­666,556,777,­777,777,775,­533,355,535,­355,553,565,­535,353,655,­655,555,565,­557,777,777,­777,756,533,­555,533,335,­353,566,655,­353,566,535,­656,655,577,­777,777,777,­565,353,535,­535,553,335,­566,666,555,­666,568,566,­665,777,777,­777,775,633,­535,555,555,­555,535,565,­556,555,666,­566,666,677,­777,777,777,­758,333,333,­355,555,656,­556,565,866,­666,866,658,­667,777,777,­777,777,582,­233,333,333,­355,565,555,­566,666,666,­868,666,677,­777,777,777,­775,822,333,­333,333,535,­555,556,666,­666,668,688,­586,777,777,­777,777,736,­355,333,333,­355,556,555,­636,666,686,­688,888,557,­777,777,777,­777,565,555,­555,333,555,­566,666,565,­686,666,886,­886,777,777,­777,777,776,­656,888,853,­335,556,686,­556,666,666,­868,886,887,­777,777,777,­777,775,356,­368,532,355,­555,688,666,­866,666,668,­668,877,777,­777,777,777,­732,233,553,­223,323,335,­533,556,666,­686,686,686,­777,777,777,­777,777,323,­333,332,222,­233,332,233,­568,665,666,­656,337,777,­777,777,777,­773,233,333,­322,222,223,­222,223,566,­556,655,533,­777,777,777,­777,777,722,­333,232,222,­222,233,222,­225,665,555,­632,277,777,­777,777,777,­777,323,333,­322,222,223,­222,222,236,­553,553,222,­777,777,777,­777,777,777,­233,232,222,­223,232,222,­223,355,533,­552,277,777,­777,777,777,­777,772,333,­333,222,233,­322,222,223,­353,233,355,­777,777,777,­777,777,777,­723,333,355,­665,533,233,­333,333,322,­335,677,777,­777,777,777,­777,777,735,­533,333,222,­233,333,333,­332,223,356,­777,777,777,­777,777,777,­777,555,333,­232,222,333,­333,333,222,­233,677,777,­777,777,777,­777,777,772,­533,332,222,­222,333,333,­322,222,255,­777,777,777,­777,777,777,­777,775,356,­566,665,553,­333,333,222,­223,557,777,­777,777,777,­777,777,777,­733,335,333,­332,223,333,­332,222,233,­577,777,777,­777,777,777,­777,777,233,­335,332,222,­223,332,322,­222,233,777,­777,777,777,­777,777,777,­777,333,232,­222,222,223,­332,222,222,­237,777,777,­777,777,777,­777,777,773,­222,222,222,­222,223,222,­322,222,377,­777,777,777,­777,777,777,­777,777,222,­222,222,222,­323,332,222,­223,777,777,­777,777,777,­777,777,777,­773,232,222,­222,333,353,­222,222,227,­777,777,777,­777,777,777,­777,777,733,­332,222,223,­355,322,222,­222,277,777,­777,777,777,­777,777,777,­777,755,333,­333,555,533,­222,222,222,­277,777,777,­777,777,777,­777,777,777,­777,775,555,­555,322,222,­222,222,777,­777,777,777,­777,777,777,­777,777,777,­755,555,533,­222,222,222,­227,777,777,­777,777,777,­777,777,777,­777,777,755,­553,332,222,­222,222,227,­777,777,777,­777,777,777,­777,777,777,­777,555,533,­322,222,222,­222,227,777,­777,777,777,­777,777,777,­777,777,773,­553,332,222,­222,222,222,­277,777,777,­777,777,777,­777,777,777,­777,735,533,­322,222,222,­222,222,277,­779,769

although it looks rather better when properly formatted.

77777777777777777777777777777777777777777777777777
77777777777777777777777777777777777777777777777777
77777777777777777777777577777777777777777777777777
77777777777777777777775238535686777777777777777777
77777777777777777753522356666886686677777777777777
77777777777777776765555556666856868667777777777777
77777777777777722233566666686668666666577777777777
77777777777773553363588665566666556656557777777777
77777777777733552236666666655665665666555777777777
77777777777727626566666665665555555555553377777777
77777777772532525666666655555565555555655577777777
77777777725222236666565555555556555535355237777777
77777777226672536653555535555555555355353357777777
77777772726373566555555553535355566553553322777777
77777772235775355665553355353535533555555223777777
77777732222225555555635355535533635565353353777777
77777722222255555655553553353553565556553532377777
77777772272355553553355535353365355355553523577777
77777733233356633355355553335535555555535355567777
77777773323555555555555555555535555355556665567777
77777775533355535355553565535353655655555565557777
77777775653355553333535356665535356653565665557777
77777775653535355355533355666665556665685666657777
77777775633535555555555535565556555666566666677777
77777775833333335555565655656586666686665866777777
77777775822333333333555655555666666668686666777777
77777775822333333333535555556666666668688586777777
77777773635533333335555655563666668668888855777777
77777775655555553335555666665656866668868867777777
77777776656888853335556686556666666868886887777777
77777777535636853235555568866686666666866887777777
77777777322335532233233355335566666866866867777777
77777777323333332222233332233568665666656337777777
77777777323333332222222322222356655665553377777777
77777777223332322222222332222256655556322777777777
77777777323333322222223222222236553553222777777777
77777777723323222222323222222335553355227777777777
77777777723333332222333222222233532333557777777777
77777777723333355665533233333333322335677777777777
77777777773553333322223333333333222335677777777777
77777777775553332322223333333332222336777777777777
77777777772533332222222333333322222255777777777777
77777777777535656666555333333322222355777777777777
77777777777333353333322233333322222335777777777777
77777777777233335332222223332322222233777777777777
77777777777733323222222222333222222223777777777777
77777777777732222222222222232223222223777777777777
77777777777777222222222222323332222223777777777777
77777777777777323222222233335322222222777777777777
77777777777777333322222233553222222222777777777777
77777777777777755333333555533222222222277777777777
77777777777777777777555555532222222222277777777777
77777777777777777777555555332222222222277777777777
77777777777777777777755553332222222222227777777777
77777777777777777777755553332222222222222777777777
77777777777777777777735533322222222222222777777777
77777777777777777777735533322222222222222277779769

I think I’ll call it the Niamh Prime.

More in the discussion (powered by webmentions)

  • Fiona C responded at ... (twitter.com)
  • Alex Balhatchet responded at twitter.com That's amazing!
  • Stuart Langridge responded at twitter.com cool idea from McKee. I would not have thought of it without that or @numberphile and @_FutilityCloset telling me about it :)
  • Drew Fitzsimmons responded at ... (twitter.com)
  • Alex Balhatchet responded at ... (twitter.com)
  • Numberphile responded at twitter.com This is escalating.
  • Jonathan Fischoff responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • mount -v /dev/sam responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • eco responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Dan Hagon responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Chris Smith responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Λογόρροια responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Mathematical_A responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • 冗談 responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Mathias Ference responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Matthew Strawbridge responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • (((Itzik))) responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Mathias Ference responded at ... (twitter.com)
  • Timothy Deng responded at ... (twitter.com)
  • TopCatMath responded at ... (twitter.com)
  • Mike Purvis responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • ioui haas responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • mount -v /dev/sam responded at ... (twitter.com)
  • Jens Klingenstein responded at twitter.com Awesome!!!
  • Yoav Shati responded at ... (twitter.com)
  • Martin Korolczuk responded at ... (twitter.com)
  • Λογόρροια responded at ... (twitter.com)
  • Bedir HALCI responded at ... (twitter.com)
  • Planar responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • smashing memories responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Chris Smith responded at ... (twitter.com)
  • Zachary Bills responded at ... (twitter.com)
  • Julian responded at ... (twitter.com)
  • (((Itzik))) responded at ... (twitter.com)
  • Tamra responded at ... (twitter.com)
  • Nicolaj Baramsky responded at ... (twitter.com)
  • benjamim responded at ... (twitter.com)
  • eco responded at ... (twitter.com)
  • Peter Collingridge responded at ... (twitter.com)
  • Matthew McKeever responded at ... (twitter.com)
  • smashing memories responded at ... (twitter.com)
  • Mauri responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Planar responded at ... (twitter.com)
  • Befedo responded at ... (twitter.com)
  • schana responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Diego responded at ... (twitter.com)
  • Vivien Parkhouse responded at ... (twitter.com)
  • Roger Shepherd responded at ... (twitter.com)
  • Andy Durdin responded at ... (twitter.com)
  • Maki my Angel responded at ... (twitter.com)
  • LukasDanielKlausner responded at ... (twitter.com)
  • Eilidh Troup responded at ... (twitter.com)
  • Jens Klingenstein responded at ... (twitter.com)
  • Akhilesh Srikanth responded at ... (twitter.com)
  • Doppelgänger responded at ... (twitter.com)
  • Pedro Suazo responded at ... (twitter.com)
  • Edgar Sánchez Gordón responded at ... (twitter.com)
  • M.Zorzy responded at ... (twitter.com)
  • Deen John uzumaki responded at ... (twitter.com)
  • DON'T-GET-ME-RIGHT responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Birmingham.IO responded at twitter.com Stuart Langridge: The Niamh prime by @sil buff.ly/2wTotNm #PlanetBirmingham
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Grandpa Gravy responded at ... (twitter.com)
  • Benjamin Slade responded at ... (twitter.com)
  • Ingolf Schaefer responded at ... (plus.google.com)
  • Ade Oshineye responded at ... (plus.google.com)
  • Jan Moren responded at ... (plus.google.com)
  • Craig Maloney responded at ... (plus.google.com)
  • Kienan Vella responded at ... (plus.google.com)
  • Jason Frey responded at ... (twitter.com)
  • Gastón Avila responded at ... (twitter.com)
  • Yeye responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Iykury responded at ... (twitter.com)
  • the Eluminator 🌐 responded at ... (twitter.com)
  • Øbliviøn responded at ... (twitter.com)
  • John Garside responded at ... (plus.google.com)
  • Jstar Valentine responded at ... (twitter.com)
  • Natálie Kaňáková responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • محمد فرحان responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Ad Brouwer responded at ... (twitter.com)
  • Olivier Campagne responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Jose F. Morales responded at ... (twitter.com)
  • Maths Ed responded at ... (twitter.com)
  • Mr Gray responded at ... (twitter.com)
  • Bmouth School Maths responded at ... (twitter.com)
  • donald clemmey responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • donald clemmey responded at ... (twitter.com)
  • W.D. Sparling responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Jono Bacon responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Jono Bacon responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Decepção responded at ... (twitter.com)
  • Corrie Strydom responded at ... (twitter.com)
  • pip010 responded at ... (twitter.com)
  • Martin Wimpress responded at ... (plus.google.com)
  • Richard Gaskin responded at ... (plus.google.com)
  • Mirco Müller responded at plus.google.com It's obvious what you'll have to get your daughter for her next birthday :)
  • Lucio Torre responded at ... (twitter.com)
  • Himadri Barman responded at twitter.com Some maths fiddling around for a Sunday afternoon: a prime that looks like my daughter. kryogenix.org/days/2017/09/1…
  • Stephen Smoogen responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Robert Cooper-Ritter responded at ... (twitter.com)
  • Izmar 🔥 responded at ... (twitter.com)
  • Robert Collins responded at ... (plus.google.com)
  • aldonogueira responded at ... (twitter.com)
  • Gamer Geek responded at twitter.com Stuart Langridge: The Niamh prime kryogenix.org/days/2017/09/1…
  • Tarus BALOG responded at ... (plus.google.com)
  • Henry W McLaughlin responded at twitter.com Pictopriming
  • John Meinel responded at plus.google.com I can't read any of those digits, please bigger pic :)
  • Stuart Langridge responded at plus.google.com See the page for all the digit detail you could ever want.
  • Cristian Tapus responded at ... (twitter.com)
  • John Read responded at ... (twitter.com)
  • wallyhort responded at ... (twitter.com)
  • Bruce Lawson responded at twitter.com The Niamh prime: flame-haired Adonis @sil finds a prime number that when printed, makes an image of his daughter kryogenix.org/days/2017/09/1…