A055126 Base-16 complement of n (write n in base 16, then replace each digit with its base-16 negative).
0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 240, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 224, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 208, 223, 222, 221, 220, 219, 218, 217, 216, 215
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..4095 (4095 = 16^3 - 1)
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Haskell
a055126 0 = 0 a055126 n = if d == 0 then 16 * a055126 n' else 16 * a055126 n' + 16 - d where (n', d) = divMod n 16 -- Reinhard Zumkeller, Mar 12 2014