OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
21 is a term since its binary representation, 10101, is palindromic, and 1 + 0 + 1 + 0 + 1 = 3 is a divisor of 21.
MATHEMATICA
Select[Range[10^6], PalindromeQ[(d = IntegerDigits[#, 2])] && Divisible[#, Plus @@ d] &]
PROG
(Python)
def ok(n): b = bin(n)[2:]; return b==b[::-1] and n%sum(map(int, b)) == 0
def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
print(aupto(1371877)) # Michael S. Branicky, Jan 21 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, May 05 2020
STATUS
approved