Advertisement
chaotic_iak

Keep running | Script

May 23rd, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.11 KB | None | 0 0
  1. def d(a, b):
  2.     i = 0
  3.     j = 0
  4.     while i * b < a:
  5.         i += 1
  6.     i -= 1
  7.     k = i * b
  8.     while k != a:
  9.         j += 1
  10.         k += 1
  11.     return i, j
  12.  
  13. def p(a):
  14.     i = 1
  15.     j = 0
  16.     while i < a:
  17.         if d(a, i)[1] == i:
  18.             j += 1
  19.         i += 1
  20.     return j - 1
  21.  
  22. a = """
  23. 43996257291946865786208341684017048690747726272979
  24. 81451999041223940509097933153580450843985004654630
  25. 38277787532041930359663538443019413493168192711794
  26. 76196329587870035238273391546086039741237498221189
  27. 60477855115878910236568826330364113488791121093903
  28. 93215495829486502838553062601267535476399617475261
  29. 54308200482600861002506427336970800337387375742872
  30. 96159323971514180365915144109737226384930067724589
  31. 26343111904390643437403719181425607995766467017846
  32. 69595424930382566893815686145528070750192884478869
  33. 17168997162577846734327326408032111711555779898267
  34. 57241386000558536549634471983234109474184512908626
  35. 90504103032805274308840045725805178502658050961847
  36. 26100273888500598504303566932230897524720308170919
  37. 80630565362717027703395497389212737897424121041343
  38. 05346028976269810346506169105152004090057464807532
  39. 61273842727228250755123445741015884383801077654111
  40. 16588229236026942384150191709277927526565770052034
  41. 79227878286317453547819799214337542714508364082784
  42. 77272952060990462931295779385676174562880452592377
  43. 52721561816627443597549202349398416701790991332770
  44. 86203362670285468432753083361230272256685027307466
  45. 84381245998236615034889408396660879832119088616070
  46. 65690393645908586800829749279236206371689860282401
  47. 97263186551094036751051633877676198604651989179723
  48. 86178741022902122321462190733930994352245883684719
  49. 12235405072391897446911609456113723951304918431382
  50. 98882807883357688653318976839789269956654057091838
  51. 22310225702421206269842815235224784592230341961511
  52. 56445363702651518569939716574939995906970607567508
  53. 56871818431310890098385407718438903001165988321058
  54. 09448788754295517392700472831487399113385118587349
  55. 50027205822090159059598458701209637057831336938590
  56. 52099012401699437149232546264748397536675876990353
  57. 48432107464838946642808095318438277508253438122041
  58. 75919121553734041101098079809285414749370090998940
  59. 24806159120281491120323365178530550411775628702539
  60. 06504565785307962338308209796706357370838417742939
  61. 17234936589795753828193551473171210475141617141084
  62. 27285710160185961731029897162771273700346491087271
  63. 40358004143636924373583890618503687199309211159055
  64. 73383319592028227869484257182263065471335409583601
  65. 68756723368764234922795489533392139690778117193141
  66. 84966146951673036975409659886991479248253063449064
  67. 33386943345943529894668425067734943425488462968890
  68. 63582986230621921407680302308161229126250608267507
  69. 70590474121070200509410385092220899665637764263858
  70. 37635184203450258409532238887785007940597133178356
  71. 20582629220229229778247097857825091143449744860116
  72. 51277842553021428393753341040338703674572887205690
  73. 54647199426065641873002621044924596979851761177373
  74. 22934451676616793607827170643217022799619134904085
  75. 65827293056923524522735565636287893854280550922917
  76. 86848463706821967494323827775547286676054148436528
  77. 50965895971204447360340284213285011405065030559904
  78. 09653004125895067587685378202500068574840766611865
  79. 86539610268117890692389727161262210891170402977051
  80. 76811092927516210412731679589941276905738753675162
  81. 56511543761265465312930328371080026703291944836236
  82. 43589204629672649839020425587436436097244167181988
  83. 28946628222741389206802651835425683492432721658087
  84. 71332556060170537183865851056588091709405632363488
  85. 90452337167900401921009032287420301770500322292130
  86. 85312399398285165373847967813254828770261620477512
  87. 43319990082720975015964089073714074587861700718873
  88. 43387921301393899077819582010457189619716037063980
  89. 96371899841538281120193380115452912732716953331662
  90. 74592953773660341403544975718333977645006435956655
  91. 17169243766043988102844213849138688522252661151972
  92. 69114159221394366254024058043762536250608664232930
  93. 71930714889901652641421307360204522644253775680810
  94. 05651920317254644606657977830679291136809535941590
  95. 84134199066429192482829170824293223059558620326744
  96. 60330127577415082635278242845398068432891108716041
  97. 19259520742493489752804201803371269743553392634687
  98. 98491577265539857640911688926704091052497625796886
  99. 09794320853220271853104811495521151587358811212304
  100. 44331146122567467577710122778448638798443265915809
  101. 40104013532189809456728745166798679283071177970800
  102. 14384473377993312241629361770840700384389630056021
  103. 48718140510250964680014766498323133736502266455711
  104. 95749048416062740148162981483339146279829421930431
  105. 60813118502453049808318473788754989140048292042255
  106. 42609526347649264631615283533412229192422106554968
  107. 90788014950750902037727209463028396130219828626232
  108. 90020413213840432775145472167815902238123598981180
  109. 8091954465266570007722498014839871137514573269
  110. """
  111. r = "! e0a1i2o3n4r5t6l7s8u9dgbcmpfhvwykjxqz"
  112. a = list(a)
  113. for i in range(len(a) - 1, -1, -1):
  114.     if ord(a[i]) < 32:
  115.         a.pop(i)
  116. a = int("".join(a))
  117.  
  118. i = 1
  119. while i <= a:
  120.     if not p(i):
  121.         j, k = d(a, i)
  122.         b = 0
  123.         while k == i:
  124.             a = j + 1
  125.             b += 1
  126.             j, k = d(a, i)
  127.         if b:
  128.             print(r[b], end="")
  129.     i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement