SHARE
TWEET

Pirates and mangoes

a guest Apr 29th, 2015 31 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def get_truth(mangoes):
  2.     for _ in range(5):
  3.         if mangoes % 5 != 1:
  4.             return False
  5.         mangoes = ((mangoes - 1) // 5) * 4
  6.     return not mangoes % 5
  7.  
  8. def count():
  9.     counter = 1
  10.     while True:
  11.         yield counter
  12.         counter += 1
  13.  
  14. for i in count():
  15.     if get_truth(i):
  16.         print(i)
  17.         break
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top