login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A124334 Nonpalindromes in base 10 that are palindromes in base 2. 1

%I #11 Apr 20 2014 16:26:47

%S 15,17,21,27,31,45,51,63,65,73,85,93,107,119,127,129,153,165,189,195,

%T 219,231,255,257,273,297,325,341,365,381,387,403,427,443,455,471,495,

%U 511,513,561,633,645,693,765,771,819,843,891,903,951,975

%N Nonpalindromes in base 10 that are palindromes in base 2.

%H Robert Israel, <a href="/A124334/b124334.txt">Table of n, a(n) for n = 1..10000</a>

%e 17(10) = 10001(2), a palindrome.

%p N:= 10000: # to get the first N entries

%p count:= 0:

%p for d from 1 while count < N do

%p d1:= ceil(d/2); d2:= d - d1;

%p for x from 2^(d1-1) to 2^d1 - 1 while count < N do

%p if d::even then x1:= x else x1 := floor(x/2) fi;

%p L:= convert(x1,base,2);

%p y:= 2^(d2)*x + add(L[j]*2^(d2-j),j=1..d2);

%p L10:= convert(y,base,10);

%p if ListTools[Reverse](L10) = L10 then next fi;

%p count:= count+1;

%p A[count]:= y;

%p od

%p od:

%p seq(A[n],n=1..N);

%p # _Robert Israel_, Apr 20 2014

%t Select[Range[1000], Reverse[IntegerDigits[ # ]] != IntegerDigits[ # ] && Reverse[IntegerDigits[ #, 2]] == IntegerDigits[ #, 2] &]

%Y Cf. A007632 = numbers that are palindromic in bases 2 and 10.

%K base,nonn

%O 1,1

%A _Tanya Khovanova_, Dec 26 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 10:11 EDT 2024. Contains 371935 sequences. (Running on oeis4.)