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.

A272670 Numbers whose binary expansion is not palindromic but which when reversed and leading zeros omitted, does form a palindrome.

This page as a plain text file.
%I A272670 #19 May 21 2016 13:38:06
%S A272670 2,4,6,8,10,12,14,16,18,20,24,28,30,32,34,36,40,42,48,54,56,60,62,64,
%T A272670 66,68,72,80,84,90,96,102,108,112,120,124,126,128,130,132,136,144,146,
%U A272670 160,168,170,180,186,192,198,204,214,216,224,238,240,248,252,254
%N A272670 Numbers whose binary expansion is not palindromic but which when reversed and leading zeros omitted, does form a palindrome.
%C A272670 Decimal interpretation of A273245. Twice A057890.
%H A272670 Chai Wah Wu, <a href="/A272670/b272670.txt">Table of n, a(n) for n = 1..10000</a>
%p A272670 isPal := proc(L::list)
%p A272670     local i;
%p A272670     for i from 1 to nops(L)/2 do
%p A272670         if op(i,L) <> op(-i,L) then
%p A272670             return false;
%p A272670         end if;
%p A272670     end do:
%p A272670     true ;
%p A272670 end proc:
%p A272670 isA272670 := proc(n)
%p A272670     local bdgs ;
%p A272670     bdgs := convert(n,base,2) ;
%p A272670     if isPal(bdgs) then
%p A272670         return false;
%p A272670     else
%p A272670         A000265(n) ;
%p A272670         bdgs := convert(%,base,2) ;
%p A272670         isPal(bdgs) ;
%p A272670     end if;
%p A272670 end proc:
%p A272670 for n from 1 to 500 do
%p A272670     if isA272670(n) then
%p A272670         printf("%d,",n) ;
%p A272670     end if;
%p A272670 end do: # _R. J. Mathar_, May 20 2016
%o A272670 (Python)
%o A272670 A272670_list = [n for n in range(1,10**4) if bin(n)[2:] != bin(n)[:1:-1] and bin(n)[2:].rstrip('0') == bin(n)[:1:-1].lstrip('0')] # _Chai Wah Wu_, May 21 2016
%Y A272670 Cf. A006995, A057890, A273245, A273329, subsequence of A154809.
%K A272670 nonn,base,easy
%O A272670 1,1
%A A272670 _N. J. A. Sloane_, May 19 2016