Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g = (x for x in xrange(1,10**7+1))
- sum = 0
- for x in g:
- x = bin(x)[2:]
- s = 0
- for y in xrange(0,len(x)-1):
- if( x[y:y+1] == '1' and x[y+1:y+2] == '1' ): s+=1
- if s == 5:
- sum += 1
- print sum
Advertisement
Add Comment
Please, Sign In to add comment