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.

A253149 Primes >= 256 that remain primes when the digits are reversed in base 256.

This page as a plain text file.
%I A253149 #14 Jun 04 2020 03:27:42
%S A253149 257,269,293,311,313,347,379,397,419,449,479,491,773,809,823,827,829,
%T A253149 857,883,887,947,953,971,977,1013,1283,1289,1297,1301,1307,1321,1327,
%U A253149 1367,1373,1399,1409,1429,1439,1451,1453,1481,1483,1511,1523,1801,1811,1847,1867
%N A253149 Primes >= 256 that remain primes when the digits are reversed in base 256.
%C A253149 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.
%H A253149 Chai Wah Wu, <a href="/A253149/b253149.txt">Table of n, a(n) for n = 1..7110</a>
%H A253149 Wikipedia, <a href="http://en.wikipedia.org/wiki/Endianness">Endianness</a>
%e A253149 1299647 is prime and written in base 16 is 13 d4 bf whereas bf d4 13 = 12571667 is also prime.
%o A253149 (Python)
%o A253149 from sympy import prime, isprime
%o A253149 def reversedigits(n, b=10): # reverse digits of n in base b
%o A253149     x, y = n, 0
%o A253149     while x >= b:
%o A253149         x, r = divmod(x, b)
%o A253149         y = b*y + r
%o A253149     return b*y + x
%o A253149 A253149_list = []
%o A253149 for n in range(1, 300):
%o A253149     p = prime(n)
%o A253149     if p > 255 and isprime(reversedigits(p,256)):
%o A253149         A253149_list.append(p)
%o A253149 print(A253149_list)
%Y A253149 Cf. A253147, A253148, A238853.
%K A253149 nonn,base
%O A253149 1,1
%A A253149 _Chai Wah Wu_, Dec 30 2014