login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

For any positive integer n with binary expansion (b_1, ..., b_w) (where b_1 = 1), the binary expansion of a(n) is (c_1, ..., c_w) with c_k = (Sum_{i = 1 mod (w+1-k)} b_i) mod 2 for k = 1..w; a(0) = 0.
3

%I #14 Apr 17 2024 04:14:11

%S 0,1,3,2,7,4,6,5,15,10,12,9,14,11,13,8,31,20,26,17,28,23,25,18,30,21,

%T 27,16,29,22,24,19,63,46,52,37,58,43,49,32,60,45,55,38,57,40,50,35,62,

%U 47,53,36,59,42,48,33,61,44,54,39,56,41,51,34,127,88,110

%N For any positive integer n with binary expansion (b_1, ..., b_w) (where b_1 = 1), the binary expansion of a(n) is (c_1, ..., c_w) with c_k = (Sum_{i = 1 mod (w+1-k)} b_i) mod 2 for k = 1..w; a(0) = 0.

%C This sequence is a permutation of the nonnegative integers with inverse A371975.

%H Rémy Sigrist, <a href="/A371974/b371974.txt">Table of n, a(n) for n = 0..8191</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F A070939(a(n)) = A070939(n).

%F a(n) mod 2 = A010060(n).

%e For n = 42: the binary expansion of 42 is "101010":

%e b_1 b_2 b_3 b_4 b_5 b_6

%e 1 0 1 0 1 0

%e c_1 = 1 = 1 mod 2

%e c_2 = 1 + 0 = 1 mod 2

%e c_3 = 1 + 1 = 0 mod 2

%e c_4 = 1 + 0 = 1 mod 2

%e c_5 = 1 + 1 + 1 = 1 mod 2

%e c_6 = 1 + 0 + 1 + 0 + 1 + 0 = 1 mod 2

%e - so the binary expansion of a(42) is "110111", and a(42) = 55.

%o (PARI) a(n) = { my (b = binary(n), c = vector(#b)); for (k = 1, #c, forstep (i = 1, #b, #b+1-k, c[k] += b[i];);); fromdigits(c % 2, 2); }

%Y See A341335 and A371976 for similar sequences.

%Y Cf. A010060, A070939, A371975 (inverse).

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Apr 14 2024