cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A253148 Nontrivial palindromes in base 10 and base 256.

This page as a plain text file.
%I A253148 #21 May 22 2025 10:21:42
%S A253148 55255,63736,92929,96769,108801,450054,516615,995599,1413141,1432341,
%T A253148 1539351,1558551,2019102,2491942,2807082,3097903,3740473,3866683,
%U A253148 3885883,4201024,4220224,4327234,4346434,4365634,4384834,5614165,5633365,5759575,6692966,7153517,7172717
%N A253148 Nontrivial palindromes in base 10 and base 256.
%C A253148 Palindromes in base 256 are numbers that are the same in big-endian and little-endian order with 8-bit words. See also A238853.
%C A253148 A palindromic number in base 10 which is below 256 is a 1-digit number in base 256. Thus, it is automatically a palindrome in base 256. This sequence excludes 1-digit numbers in base 256. - _Tanya Khovanova_, Aug 21 2021
%H A253148 Chai Wah Wu, <a href="/A253148/b253148.txt">Table of n, a(n) for n = 1..121</a>
%H A253148 Wikipedia, <a href="http://en.wikipedia.org/wiki/Endianness">Endianness</a>
%e A253148 7172717 in base 16 is 6d 72 6d and the bytes form a palindrome.
%t A253148 Select[Range[256, 10000000], PalindromeQ[#] && PalindromeQ[IntegerDigits[#, 256]] &] (* _Tanya Khovanova_, Aug 21 2021 *)
%o A253148 (Python)
%o A253148 from __future__ import division
%o A253148 def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l
%o A253148     if l > 0:
%o A253148         yield 0
%o A253148         for x in range(1, l+1):
%o A253148             n = b**(x-1)
%o A253148             n2 = n*b
%o A253148             for y in range(n, n2):
%o A253148                 k, m = y//b, 0
%o A253148                 while k >= b:
%o A253148                     k, r = divmod(k, b)
%o A253148                     m = b*m + r
%o A253148                 yield y*n + b*m + k
%o A253148             for y in range(n, n2):
%o A253148                 k, m = y, 0
%o A253148                 while k >= b:
%o A253148                     k, r = divmod(k, b)
%o A253148                     m = b*m + r
%o A253148                 yield y*n2 + b*m + k
%o A253148 def reversedigits(n, b=10): # reverse digits of n in base b
%o A253148     x, y = n, 0
%o A253148     while x >= b:
%o A253148         x, r = divmod(x, b)
%o A253148         y = b*y + r
%o A253148     return b*y + x
%o A253148 A253148_list = []
%o A253148 for n in palgen(5):
%o A253148     if n > 255 and n == reversedigits(n,256):
%o A253148         A253148_list.append(n)
%Y A253148 Cf. A253147, A253149, A238853.
%K A253148 nonn,base
%O A253148 1,1
%A A253148 _Chai Wah Wu_, Dec 30 2014
%E A253148 Name clarified by _Tanya Khovanova_, Aug 21 2021