login
A393187
a(n) = n XOR (2 * (n AND -n)) assuming a two's complement representation of negative values.
2
3, 6, 1, 12, 7, 2, 5, 24, 11, 14, 9, 4, 15, 10, 13, 48, 19, 22, 17, 28, 23, 18, 21, 8, 27, 30, 25, 20, 31, 26, 29, 96, 35, 38, 33, 44, 39, 34, 37, 56, 43, 46, 41, 36, 47, 42, 45, 16, 51, 54, 49, 60, 55, 50, 53, 40, 59, 62, 57, 52, 63, 58, 61, 192, 67, 70, 65
OFFSET
1,1
COMMENTS
Computed by Wolfram's 2-state 2-symbol Turing machine 2223 when started with n on the tape.
Bitflip of the second lowest bit of the odd part of n. - Ruud H.G. van Tol, Apr 26 2026
MATHEMATICA
a[n_] := BitXor[n, 2*BitAnd[n, -n]]; Array[a, 68] (* Michael De Vlieger, Feb 06 2026 *)
PROG
(PARI) a(n) = bitxor(n, 2*bitand(n, -n)); \\ Michel Marcus, Feb 05 2026
(PARI) a(n) = bitxor(n, 2<<valuation(n, 2)); \\ Ruud H.G. van Tol, Apr 26 2026
(Python)
def A393187(n): return n^((n&-n)<<1) # Chai Wah Wu, Feb 07 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sean A. Irvine, Feb 04 2026
STATUS
approved