Two-Base Palindromes
A palindrome reads the same from left to right and from right to left. Write a function double_base_palindrome_sum that finds all numbers less than n that are palindromes in both base 10 and base 2. Check the binary form without leading zeros. Return the sum of all matching numbers.
Примеры
Ввод
1000000Вывод
872187Ввод
10Вывод
25Ввод
100Вывод
157Нужно реализовать
def double_base_palindrome_sum(n: int) -> int:
Теги
mathstrings
Log ind for at se indsendelseshistorik
Log indLog ind for at bruge AI-mentor
Log indVisible tests
1
Input
1000000Expected
8721872
Input
10Expected
253
Input
100Expected
1574
Input
1000Expected
17725
Input
9Expected
166
Input
1Expected
0Focus radio
Paused · SomaFM · Fluid