A272670 Numbers whose binary expansion is not palindromic but which when reversed and leading zeros omitted, does form a palindrome.
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
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
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
Comments