cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A341335 For any number n with binary expansion (b_1, ..., b_k), the binary expansion of a(n), say (c_1, ..., c_k) satisfies c_m = Sum_{d | m} b_d mod 2 for m = 1..k.

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 10, 11, 8, 9, 31, 30, 29, 28, 27, 26, 25, 24, 21, 20, 23, 22, 17, 16, 19, 18, 63, 62, 61, 60, 59, 58, 57, 56, 54, 55, 52, 53, 50, 51, 48, 49, 42, 43, 40, 41, 46, 47, 44, 45, 35, 34, 33, 32, 39, 38, 37, 36, 127, 126, 125
Offset: 0

Views

Author

Rémy Sigrist, Apr 25 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A341336.
This sequence operates on binary expansions in the same way as the XOR-Moebius transform described in A295901.
This sequence has only two fixed points: a(0) = 0, a(1) = 1.

Examples

			For n = 42:
- the binary expansion of 42 is (1, 0, 1, 0, 1, 0),
- the binary expansion of a(42) has 6 digits:
    - the 1st digit = 1                     mod 2 = 1,
    - the 2nd digit = 1 + 0                 mod 2 = 1,
    - the 3rd digit = 1     + 1             mod 2 = 0,
    - the 4th digit = 1 + 0     + 0         mod 2 = 1,
    - the 5th digit = 1             + 1     mod 2 = 0,
    - the 6th digit = 1 + 0 + 1         + 0 mod 2 = 0,
- so the binary expansion of a(42) is "110100",
- and a(42) = 52.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (b=binary(n), c=vector(#b)); for (m=1, #b, fordiv (m, d, c[m]=(c[m] + b[d])%2)); fromdigits(c, 2) }

Formula

a(n) < 2^k for any n < 2^k.
a(floor(n/2)) = floor(a(n)/2).
a(2^k) = 2^(k+1) - 1 for any k >= 0.