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.

A124334 Nonpalindromes in base 10 that are palindromes in base 2.

This page as a plain text file.
%I A124334 #13 Nov 10 2024 15:18:51
%S A124334 15,17,21,27,31,45,51,63,65,73,85,93,107,119,127,129,153,165,189,195,
%T A124334 219,231,255,257,273,297,325,341,365,381,387,403,427,443,455,471,495,
%U A124334 511,513,561,633,645,693,765,771,819,843,891,903,951,975
%N A124334 Nonpalindromes in base 10 that are palindromes in base 2.
%H A124334 Robert Israel, <a href="/A124334/b124334.txt">Table of n, a(n) for n = 1..10000</a>
%e A124334 17(10) = 10001(2), a palindrome.
%p A124334 N:= 10000: # to get the first N entries
%p A124334 count:= 0:
%p A124334 for d from 1 while count < N do
%p A124334    d1:= ceil(d/2); d2:= d - d1;
%p A124334    for x from 2^(d1-1) to 2^d1 - 1 while count < N do
%p A124334       if d::even then x1:= x else x1 := floor(x/2) fi;
%p A124334       L:= convert(x1,base,2);
%p A124334       y:= 2^(d2)*x + add(L[j]*2^(d2-j),j=1..d2);
%p A124334       L10:= convert(y,base,10);
%p A124334       if ListTools[Reverse](L10) = L10 then next fi;
%p A124334       count:= count+1;
%p A124334       A[count]:= y;
%p A124334    od
%p A124334 od:
%p A124334 seq(A[n],n=1..N);
%p A124334 # _Robert Israel_, Apr 20 2014
%t A124334 Select[Range[1000], Reverse[IntegerDigits[ # ]] != IntegerDigits[ # ] && Reverse[IntegerDigits[ #, 2]] == IntegerDigits[ #, 2] &]
%t A124334 pal2[n_]:=With[{c=IntegerDigits[n,2]},c==Reverse[c]]; Select[Range[1000],!PalindromeQ[#]&&pal2[#]&] (* _Harvey P. Dale_, Nov 10 2024 *)
%Y A124334 Cf. A007632 = numbers that are palindromic in bases 2 and 10.
%K A124334 base,nonn
%O A124334 1,1
%A A124334 _Tanya Khovanova_, Dec 26 2006