A256755 a(n) = bitwise OR of n and the reverse of n.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 29, 31, 47, 63, 61, 87, 83, 91, 22, 29, 22, 55, 58, 61, 62, 91, 94, 93, 31, 31, 55, 33, 43, 55, 63, 109, 119, 127, 44, 47, 58, 43, 44, 63, 110, 111, 116, 127, 55, 63, 61, 55, 63, 55, 121, 123, 127, 127, 62, 61, 62, 63, 110
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- Wikipedia, Bitwise operation
Programs
-
Maple
a:= n-> Bits[Or](n, (s-> parse(cat(s[-i]$i=1..length(s))))(""||n)): seq(a(n), n=0..80);
-
Mathematica
Table[BitOr[n,FromDigits[Reverse[IntegerDigits[n]]]],{n,0,64}] (* Ivan N. Ianakiev, Apr 10 2015 *)
-
PARI
a(n) = bitor(n, subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Apr 10 2015