Guest User

Immediate Circular Routes

a guest
Jan 3rd, 2021
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pi = ''
  2.  
  3. with open('/path/to/pi_20m.txt') as the_file: pi = the_file.read()
  4.  
  5. for i in range(1, 1000000):
  6.     s = str(i)
  7.  
  8.     end_of = pi.find(s) + len(s)
  9.     end_of2 = pi.find(str(end_of)) + len(str(end_of))
  10.  
  11.     if end_of2 == i and end_of != i:
  12.         print('\n' + str(i) + ' first appears in Pi at the end of ' + str(end_of) + ' digits')
  13.         print(str(end_of) + ' first appears in Pi at the end of ' + str(end_of2) + ' digits\n')
  14.  
  15.     if i % 10000 == 0:
  16.         print('At number ' + str(i))
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×