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
Michael S. Branicky, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,base
AUTHOR
James S. DeArmon, Aug 21 2025
EXTENSIONS
More terms from Michael S. Branicky, Aug 22 2025
STATUS
approved
