login
A387199
Numbers which are not themselves palindromes, but a single swap of two digits creates a palindrome.
1
110, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 211, 220, 221, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255, 266, 277, 288, 299, 311, 322, 330, 331, 332, 334, 335, 336, 337, 338, 339, 344, 355, 366, 377, 388, 399, 411, 422
OFFSET
1,1
COMMENTS
Might be called "single-transposition palindromes".
Leading zeros are not allowed in either the initial number or the resultant palindrome.
LINKS
EXAMPLE
110 is a term since a swap of the second and third digits yields the palindrome 101.
PROG
(Python)
def pal(s): return s == s[::-1]
def swaps(s): yield from (t for i in range(len(s)-1) for j in range(i+1, len(s)) if (t:=s[:i]+s[j]+s[i+1:j]+s[i]+s[j+1:])[0]!='0')
def ok(n): return not pal(s:=str(n)) and any(pal(t) for t in swaps(s))
print([k for k in range(425) if ok(k)]) # Michael S. Branicky, Aug 22 2025
CROSSREFS
Cf. A002113.
Sequence in context: A112891 A182621 A267254 * A036230 A171236 A279421
KEYWORD
nonn,base
AUTHOR
James S. DeArmon, Aug 21 2025
EXTENSIONS
More terms from Michael S. Branicky, Aug 22 2025
STATUS
approved