login
A371976
For any nonnegative integer n with binary expansion Sum_{i >= 0} b_i * 2^i, the binary expansion of a(n) is Sum_{i >= 0} c_i * 2^i with c_i = (Sum_{k > 0} b_{k*(i+1)-1}) mod 2 for any i >= 0.
3
0, 1, 3, 2, 5, 4, 6, 7, 11, 10, 8, 9, 14, 15, 13, 12, 17, 16, 18, 19, 20, 21, 23, 22, 26, 27, 25, 24, 31, 30, 28, 29, 39, 38, 36, 37, 34, 35, 33, 32, 44, 45, 47, 46, 41, 40, 42, 43, 54, 55, 53, 52, 51, 50, 48, 49, 61, 60, 62, 63, 56, 57, 59, 58, 65, 64, 66, 67
OFFSET
0,3
COMMENTS
This sequence is a permutation of the nonnegative integers with inverse A371977.
FORMULA
A070939(a(n)) = A070939(n).
a(n) mod 2 = A010060(n).
EXAMPLE
For n = 42: the binary expansion of 42 is "101010":
b_5 b_4 b_3 b_2 b_1 b_0
1 0 1 0 1 0
c_5 = 1 = 1 mod 2
c_4 = 0 = 0 mod 2
c_3 = 1 = 1 mod 2
c_2 = 1 + 0 = 1 mod 2
c_1 = 1 + 1 + 1 = 1 mod 2
c_0 = 1 + 0 + 1 + 0 + 1 + 0 = 1 mod 2
- so the binary expansion of a(42) is "101111", and a(42) = 47.
PROG
(PARI) a(n) = { my (b = Vecrev(binary(n)), c = vector(#b)); for (i = 1, #b, forstep (k = i, #b, i, c[i] += b[k]; ); ); fromdigits(Vecrev(c) % 2, 2); }
CROSSREFS
See A371974 for a similar sequence.
Cf. A010060, A070939, A371977 (inverse).
Sequence in context: A266154 A266089 A371977 * A340478 A340402 A379472
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Apr 14 2024
STATUS
approved