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.

A361478 Irregular table T(n, k), n >= 0, k = 1..A361477(n), read by rows; the n-th row lists the integers whose binary expansions have the same multiset of run-lengths as that of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 5, 4, 6, 7, 8, 14, 9, 11, 13, 10, 9, 11, 13, 12, 9, 11, 13, 8, 14, 15, 16, 30, 17, 23, 29, 18, 20, 22, 26, 19, 25, 27, 18, 20, 22, 26, 21, 18, 20, 22, 26, 17, 23, 29, 24, 28, 19, 25, 27, 18, 20, 22, 26, 19, 25, 27, 24, 28, 17, 23, 29, 16, 30
Offset: 0

Views

Author

Rémy Sigrist, Mar 13 2023

Keywords

Comments

This sequence has similarities with A187786; here we consider multisets of run-lengths, there multisets of digits in binary expansions.

Examples

			Table T(n, k) begins (in decimal and in binary):
  n   n-th row    bin(n)  n-th row in binary
  --  ----------  ------  ------------------
   0  0                0  0
   1  1                1  1
   2  2               10  10
   3  3               11  11
   4  4, 6           100  100, 110
   5  5              101  101
   6  4, 6           110  100, 110
   7  7              111  111
   8  8, 14         1000  1000, 1110
   9  9, 11, 13     1001  1001, 1011, 1101
  10  10            1010  1010
  11  9, 11, 13     1011  1001, 1011, 1101
  12  12            1100  1100
  13  9, 11, 13     1101  1001, 1011, 1101
  14  8, 14         1110  1000, 1110
  15  15            1111  1111
  16  16, 30       10000  10000, 11110
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = A361479(n).
T(n, A361477(n)) = A361480(n).

A361479 a(n) is the least integer whose binary expansion has the same multiset of run-lengths as that of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 4, 7, 8, 9, 10, 9, 12, 9, 8, 15, 16, 17, 18, 19, 18, 21, 18, 17, 24, 19, 18, 19, 24, 17, 16, 31, 32, 33, 34, 35, 36, 37, 36, 35, 34, 37, 42, 37, 36, 37, 34, 33, 48, 35, 36, 51, 36, 37, 36, 35, 56, 35, 34, 35, 48, 33, 32, 63, 64, 65, 66, 67
Offset: 0

Views

Author

Rémy Sigrist, Mar 13 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r=vecsort(r); my (h=0, t=#r+1, v=0); for (k=1, #r, v=(v+k%2)*2^if (k%2, r[h++], r[t--])-k%2;); return (v); }

Formula

a(a(n)) = a(n).
a(n) <= n with equality iff n = 0 or belongs to A175020.
Showing 1-2 of 2 results.