#Completed 9/13/2021 14:26
def isPalindrome(n):
n = list(str(n))
m = list(reversed(n))
if n == m:
return True
else:
return False
def isBitPalindrome(n):
n = str(bin(n))
return isPalindrome(n[2:])
count = 0
for x in range(1, 1000000):
if(isPalindrome(x) and isBitPalindrome(x)):
count+=x
print("Answer is:", count)