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.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 30, 32, 34, 36, 40, 42, 48, 54, 56, 60, 62, 64, 66, 68, 72, 80, 84, 90, 96, 102, 108, 112, 120, 124, 126, 128, 130, 132, 136, 144, 146, 160, 168, 170, 180, 186, 192, 198, 204, 214, 216, 224, 238, 240, 248, 252, 254
Offset: 1

Views

Author

N. J. A. Sloane, May 19 2016

Keywords

Comments

Decimal interpretation of A273245. Twice A057890.

Crossrefs

Cf. A006995, A057890, A273245, A273329, subsequence of A154809.

Programs

  • Maple
    isPal := proc(L::list)
        local i;
        for i from 1 to nops(L)/2 do
            if op(i,L) <> op(-i,L) then
                return false;
            end if;
        end do:
        true ;
    end proc:
    isA272670 := proc(n)
        local bdgs ;
        bdgs := convert(n,base,2) ;
        if isPal(bdgs) then
            return false;
        else
            A000265(n) ;
            bdgs := convert(%,base,2) ;
            isPal(bdgs) ;
        end if;
    end proc:
    for n from 1 to 500 do
        if isA272670(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, May 20 2016
  • Python
    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