login
A346221
Palindromes that are multiples of 11 and whose digit sum is also a multiple of 11.
1
2992, 3883, 4774, 5665, 6556, 7447, 8338, 9229, 10901, 20702, 30503, 40304, 50105, 70807, 80608, 90409, 119911, 128821, 137731, 146641, 155551, 164461, 173371, 182281, 191191, 209902, 218812, 227722, 236632, 245542, 254452, 263362, 272272, 281182, 290092, 308803
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
Cf. A002113, A083513, A166311 (halves of even length terms), A216995.
Sequence in context: A221725 A205241 A317398 * A253962 A253955 A253758
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Jul 11 2021
STATUS
approved