OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
17(10) = 10001(2), a palindrome.
MAPLE
N:= 10000: # to get the first N entries
count:= 0:
for d from 1 while count < N do
d1:= ceil(d/2); d2:= d - d1;
for x from 2^(d1-1) to 2^d1 - 1 while count < N do
if d::even then x1:= x else x1 := floor(x/2) fi;
L:= convert(x1, base, 2);
y:= 2^(d2)*x + add(L[j]*2^(d2-j), j=1..d2);
L10:= convert(y, base, 10);
if ListTools[Reverse](L10) = L10 then next fi;
count:= count+1;
A[count]:= y;
od
od:
seq(A[n], n=1..N);
# Robert Israel, Apr 20 2014
MATHEMATICA
Select[Range[1000], Reverse[IntegerDigits[ # ]] != IntegerDigits[ # ] && Reverse[IntegerDigits[ #, 2]] == IntegerDigits[ #, 2] &]
pal2[n_]:=With[{c=IntegerDigits[n, 2]}, c==Reverse[c]]; Select[Range[1000], !PalindromeQ[#]&&pal2[#]&] (* Harvey P. Dale, Nov 10 2024 *)
CROSSREFS
KEYWORD
base,nonn,changed
AUTHOR
Tanya Khovanova, Dec 26 2006
STATUS
approved