A355148 Numbers that are the concatenation of two palindromes and that have exactly two palindromic factors, all with the same number of decimal digits.
12, 14, 15, 16, 18, 21, 24, 25, 27, 28, 32, 35, 36, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81, 3388, 7744, 101787, 101808, 111888, 151848, 212565, 212898, 232656, 313464, 313575, 353868, 383595, 383838, 414585, 434676, 454545, 505808, 515595, 525252, 555888
Offset: 1
Examples
42 is the concatenation of 4 and 2, and is also 6*7 (all 1 digit). 3388 is the concatenation of 33 and 88, and is also 44*77 (all 2 digits). 414585 is the concatenation of 414 and 585, and is also 555*747 (all 3 digits). 131080 = 232*565 is not a term since 080 begins with 0 and hence is not a three-digit palindromic number. 79974224 = 8998*8888, 7999742224 = 89998*88888, 799997422224 = 899998*888888 (see comments).
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..597
- Nicolas Bělohoubek, Table of n, a(n) for n = 1..56
Programs
-
Python
from sympy import divisors from itertools import count, islice, product def ispal(s): return s == s[::-1] def pals(d, start0=False): # generates palindromic strings with d digits digits = "0123456789" if d == 1: yield from "0"*int(start0) + "123456789"; return for p in product(digits, repeat=d//2): if not start0 and p[0] == "0": continue left = "".join(p); right = left[::-1] for mid in [[""], digits][d%2]: yield left + mid + right def agen(): # generator of terms for d in count(1): found = set() for p1 in pals(d): for p2 in pals(d): p = int(p1)*int(p2) s = str(p) if len(s) != 2*d: continue if ispal(s[:d]) and s[d] != "0" and ispal(s[d:]): found.add(p) yield from sorted(found) print(list(islice(agen(), 51))) # Michael S. Branicky, Jun 21 2022
Comments