OFFSET
1,1
LINKS
Attila Olah, Table of n, a(n) for n=1..43964
Lubomira Dvorakova, Stanislav Kruml, and David Ryzak, Antipalindromic numbers, arXiv:2008.06864 [math.CO], 2020. Mentions this sequence.
R. Potůček, On the Relation Between Binary Palindromes with Three Alternate Blocks and Fermat Numbers, Equations 5 (2025), 100-105. See p. 100.
Eric Weisstein's World of Mathematics, Palindromic Prime.
FORMULA
MAPLE
isA016041 := proc(n)
local bin, dig ;
if isprime(n) then
bin := convert(n, base, 2) ;
for dig from 1 to nops(bin)/2 do
if op(dig, bin) <> op(-dig, bin) then
return false;
end if;
end do ;
return true;
else
false ;
end if ;
end proc:
for i from 1 to 900 do p := ithprime(i) : if isA016041(p) then printf("%d, ", A007088(p)) ; fi ; od : # R. J. Mathar, Feb 25 2007
MATHEMATICA
pal2Q[n_] := Reverse[x = IntegerDigits[n, 2]] == x; BaseForm[Select[Prime[Range[700]], pal2Q[#] &], 2] (* Jayanta Basu, Jun 24 2013 *)
(* Alternative: *)
FromDigits /@ Select[IntegerDigits[Prime@ Range[1000], 2], PalindromeQ] (* Michael De Vlieger, Oct 28 2020 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): # generator of terms
yield 11
for d in count(3, 2):
for rest in product("01", repeat=d//2-1):
left = "1" + "".join(rest)
for mid in "01":
if isprime(int(left + mid + left[::-1], 2)):
yield int(left + mid + left[::-1])
print(list(islice(agen(), 24))) # Michael S. Branicky, Jun 23 2026
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Martin Renner, Apr 13 2006
STATUS
approved
