sum = 0for i in range(310000, 320000): if i // 10000 == 31 and i % 100 // 10 == i % 10 and i % 16 == 0 and i % 46 == 0: print(i) sum += 1print(sum)