Guest User

Double End Of

a guest
Nov 22nd, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. pi = ''
  2.  
  3. with open('/path/to/pi.txt') as the_file: pi = the_file.read()      # This file should start without "3." in the front
  4.  
  5. for n in range(1, 7):
  6.     for i in range(0, len(pi)):
  7.         end_of = i + n
  8.         num = pi[i:end_of]
  9.         d = int(num) * 2
  10.  
  11.         if d == end_of:
  12.             print(num)
  13.  
  14. """
  15. Pi: 5, 19, 94, 619, 61512
  16. Phi:    1, 3, 8, 331, 519, 1129, 44905, 49229, 66762
  17. e:      1, 2, 636, 637, 190853
  18. em: 2, 8, 12, 8403, 08403, 46466, 51309, 71069, 77172
  19. 2Pi:    92, 7084, 7212, 13485, 45163, 92165
  20. """
Advertisement
Add Comment
Please, Sign In to add comment