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.

Showing 1-2 of 2 results.

A341915 For any nonnegative number n with runs in binary expansion (r_1, ..., r_w), a(n) = Sum_{k = 1..w} 2^(r_1 + ... + r_k - 1).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 23 2021

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A341916.
This sequence has connections with A003188; here we compute partials sums of runs from left to right, there from right to left.

Examples

			For n = 23,
- the binary representation of 23 is "10111",
- the corresponding run lengths are (1, 1, 3),
- so a(23) = 2^(1-1) + 2^(1+1-1) + 2^(1+1+3-1) = 19.
		

Crossrefs

Cf. A003188, A005811, A059893, A101211, A341916 (inverse), A341943 (fixed points).

Programs

  • Mathematica
    a[n_] := If[n == 0, 0, 2^((Length /@ Split[IntegerDigits[n, 2]] // Accumulate)-1) // Total];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 02 2022 *)
  • PARI
    a(n) = { my (v=0); while (n, my (w=valuation(n+n%2,2)); n\=2^w; v=2^w*(1+v)); v/2 }

Formula

a(n) = A059893(A003188(n)).
a(n) = Sum_{k = 1..A005811(n)} 2^((Sum_{m = 1..k} A101211(m))-1).
a(n) < 2^k for any n < 2^k.
A000120(a(n)) = A000120(A003188(n)) = A005811(n).

A341916 Inverse permutation to A341915.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 24 2021

Keywords

Examples

			A341915(5) = 7, so a(7) = 5.
		

Crossrefs

Cf. A006068, A059893, A341915 (inverse), A341943 (fixed points).

Programs

  • PARI
    See Links section.

Formula

a(n) = A006068(A059893(n)).
a(n) < 2^k for any n < 2^k.
Showing 1-2 of 2 results.