Created
December 30, 2011 00:20
-
-
Save paulmakepeace/1536879 to your computer and use it in GitHub Desktop.
Which European country's phone calling code requires the longest search into π?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://twitter.com/#!/paulmakepeace/status/152405728848650240 | |
"I mulled over this: which European country's phone calling code requires the longest search into π? | |
E.g. Switzerland +41, 3 digits #math #pi" | |
A couple of folks asked about very small "countries" or territories that | |
had seemingly long calling codes but which are actually subsumed under | |
e.g. North American Numbering Plan (+1) which isn't in Europe anyway, | |
Vatican City (+379 & +39), Curaçao (+599-9) under Netherlands Caribbean, | |
etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"Moldova", 5230} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
offsetInPi[s_List] := | |
Position[Partition[RealDigits[N[Pi, 10000]][[1]], Length[s], 1], | |
s][[1, 1]] | |
europeCallingCodes = {#, | |
ToExpression[Characters[CountryData[#, "CallingCode"]]]} & /@ | |
CountryData["Europe"] | |
First[Sort[ | |
Cases[europeCallingCodes, | |
x_ :> {x[[1]], offsetInPi[x[[2]]]}], #1[[2]] > #2[[2]] &]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment