Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(N):
- s = bin(N)[2:]
- if N % 2 == 1:
- s = '1' + s + '00'
- return int(s,2)
- k = 0
- for i in s:
- k += int(i)
- s += bin(k)[2:]
- return int(s,2)
- k = 0
- for N in range(1,10**3):
- F = f(N)
- if F >= 500 and F <= 700:
- k += 1
- print(N)
- print(k)
- """
- 61
- 62
- 63
- 78
- 86
- 130
- 132
- 134
- 136
- 138
- 140
- 144
- 146
- 148
- 152
- 160
- 162
- 164
- 168
- 256
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement