OFFSET
1,1
COMMENTS
Reversing the digits in base 256 is equivalent to reading a number in big-endian format using little-endian order with 8-bit words. See also A238853.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..176
Wikipedia, Endianness
EXAMPLE
2857582 is in the sequence since 2857582 is 2b 9a 6e in base 16 and 6e 9a 2b = 7248427 is a palindrome.
PROG
(Python)
def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l
if l > 0:
yield 0
for x in range(1, l+1):
n = b**(x-1)
n2 = n*b
for y in range(n, n2):
k, m = y//b, 0
while k >= b:
k, r = divmod(k, b)
m = b*m + r
yield y*n + b*m + k
for y in range(n, n2):
k, m = y, 0
while k >= b:
k, r = divmod(k, b)
m = b*m + r
yield y*n2 + b*m + k
def reversedigits(n, b=10): # reverse digits of n in base b
x, y = n, 0
while x >= b:
x, r = divmod(x, b)
y = b*y + r
return b*y + x
A253147_list = []
for n in palgen(4):
x = reversedigits(n, 256)
if n > 255 and x == reversedigits(x, 10):
A253147_list.append(n)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Dec 29 2014
STATUS
approved