OFFSET
1,1
COMMENTS
Palindromes in A216995.
EXAMPLE
11 is a palindrome that is a multiple of 11, but its digit sum is not divisible by 11. Thus, 11 is not in this sequence.
MATHEMATICA
Select[Range[400000], PalindromeQ[#] && IntegerQ[#/11] && IntegerQ[Total[IntegerDigits[#]]/11] &]
PROG
(Python)
from itertools import product
def sd(n): return sum(map(int, str(n)))
def pals(d, base=10): # all positive d-digit palindromes
digits = "".join(str(i) for i in range(base))
for p in product(digits, repeat=d//2):
if d > 1 and p[0] == "0": continue
left = "".join(p); right = left[::-1]
for mid in [[""], digits][d%2]:
t = int(left + mid + right)
if t > 0: yield t
def ok(pal): return pal%11 == 0 and sd(pal)%11 == 0
print([p for d in range(1, 7) for p in pals(d) if ok(p)]) # Michael S. Branicky, Jul 11 2021
(PARI) isok(m) = my(d=digits(m)); (Vecrev(d) == d) && !(m % 11) && !(vecsum(d) % 11); \\ Michel Marcus, Aug 06 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Jul 11 2021
STATUS
approved