OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
51 in binary is 110011, which is a palindrome. 51 is divisible by the primes 3 and 17. 3 in binary is 11, a palindrome. And 17 in binary is 10001, also a palindrome. Since all the primes dividing the binary palindrome 51 are themselves binary palindromes, then 51 is included in this sequence.
MAPLE
dmax:= 15: # to get all terms with at most dmax binary digits
revdigs:= proc(n)
local L, Ln, i;
L:= convert(n, base, 2);
Ln:= nops(L);
add(L[i]*2^(Ln-i), i=1..Ln);
end proc:
isbpali:= proc(n) option remember; local L; L:= convert(n, base, 2); L=ListTools:-Reverse(L) end proc:
Bp:= {0, 1}:
for d from 2 to dmax do
if d::even then
Bp:= Bp union {seq(2^(d/2)*x + revdigs(x), x=2^(d/2-1)..2^(d/2)-1)}
else
m:= (d-1)/2;
B:={seq(2^(m+1)*x + revdigs(x), x=2^(m-1)..2^m-1)};
Bp:= Bp union B union map(`+`, B, 2^m)
fi
od:
R:= select(t -> andmap(isbpali, numtheory:-factorset(t)), Bp minus {0}):
sort(convert(R, list)); # Robert Israel, Dec 19 2016
MATHEMATICA
binPalQ[n_] := PalindromeQ @ IntegerDigits[n, 2]; Select[Range[6000], binPalQ[#] && AllTrue[FactorInteger[#][[;; , 1]], binPalQ] &] (* Amiram Eldar, Mar 30 2021 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 27 2009
EXTENSIONS
More terms from Sean A. Irvine, Nov 10 2009
STATUS
approved