Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def uberi(s):
- lol = ""
- for i in range(len(s)-2):
- if i <= (len(s)-2)//2:
- lol+='1'
- else:
- lol+='0'
- return lol
- a = int(input())
- ans = ""
- s = ""
- check = 0
- bina = str(bin(a))
- for i in range(len(bina) - 2):
- s += bina[2+i]
- if(len(s) % 2 == 0):
- kek = len(s) // 2
- tr = len(s) -1
- else:
- kek = len(s) // 2 + 1
- tr = len(s)
- for i in range(tr):
- if i <= tr // 2:
- ans+='1'
- else:
- ans+='0'
- for i in range(kek):
- if a % int(ans,2) == 0 and check == 0:
- check = 1
- print(int(ans,2))
- else:
- if check == 0:
- ans = uberi(ans)
Add Comment
Please, Sign In to add comment