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-4 of 4 results.

A352726 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of n and a(n) have no common runs of consecutive 1's.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
This sequence has similarities with A238757; here we consider runs of consecutive 1's, there individual 1's in binary expansions.
The binary expansion of n and a(n) may share some 1's, but cannot have a common run of consecutive 1's (as given by A352724).

Examples

			The first terms, alongside the corresponding partitions into runs of 1's, are:
  n   a(n)  runs in n  runs in a(n)
  --  ----  ---------  ------------
   0     0  []         []
   1     2  [1]        [2]
   2     1  [2]        [1]
   3     4  [3]        [4]
   4     3  [4]        [3]
   5     6  [1, 4]     [6]
   6     5  [6]        [1, 4]
   7     8  [7]        [8]
   8     7  [8]        [7]
   9    12  [1, 8]     [12]
  10    13  [2, 8]     [1, 12]
  11    14  [3, 8]     [14]
  12     9  [12]       [1, 8]
  13    10  [1, 12]    [2, 8]
  14    11  [14]       [3, 8]
  15    16  [15]       [16]
  16    15  [16]       [15]
		

Crossrefs

Programs

  • PARI
    See Links section.

A352727 Square array A(n, k), n, k >= 0, read by antidiagonals: the binary expansion of A(n, k) contains the runs of consecutive 1's that appear both in the binary expansions of n and k.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0
Offset: 0

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

We only consider maximal runs of one or more consecutive 1's (as counted by A069010) that completely match in binary expansions of n and k, not simply single common 1's.

Examples

			Table A(n, k) begins:
  n\k|  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
  ---+------------------------------------------------------
    0|  0  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0
    1|  0  1  0  0  0  1  0  0  0  1   0   0   0   1   0   0
    2|  0  0  2  0  0  0  0  0  0  0   2   0   0   0   0   0
    3|  0  0  0  3  0  0  0  0  0  0   0   3   0   0   0   0
    4|  0  0  0  0  4  4  0  0  0  0   0   0   0   0   0   0
    5|  0  1  0  0  4  5  0  0  0  1   0   0   0   1   0   0
    6|  0  0  0  0  0  0  6  0  0  0   0   0   0   0   0   0
    7|  0  0  0  0  0  0  0  7  0  0   0   0   0   0   0   0
    8|  0  0  0  0  0  0  0  0  8  8   8   8   0   0   0   0
    9|  0  1  0  0  0  1  0  0  8  9   8   8   0   1   0   0
   10|  0  0  2  0  0  0  0  0  8  8  10   8   0   0   0   0
   11|  0  0  0  3  0  0  0  0  8  8   8  11   0   0   0   0
   12|  0  0  0  0  0  0  0  0  0  0   0   0  12  12   0   0
   13|  0  1  0  0  0  1  0  0  0  1   0   0  12  13   0   0
   14|  0  0  0  0  0  0  0  0  0  0   0   0   0   0  14   0
   15|  0  0  0  0  0  0  0  0  0  0   0   0   0   0   0  15
		

Crossrefs

Programs

  • PARI
    A352724(n) = { my (r=[], o=0); while (n, my (v=valuation(n+n%2, 2)); if (n%2, r=concat(r, (2^v-1)*2^o)); o+=v; n\=2^v); r }
    A(n,k) = vecsum(setintersect(A352724(n), A352724(k)))

Formula

A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, n) = n.
A(n, 2*n) = 0.
A(n, k) <= A004198(n, k) (bitwise AND operator).
A(n, n+1) = A352729(n).

A352729 The binary expansion of a(n) contains the runs of consecutive 1's that appear both in the binary expansions of n and n+1.

Original entry on oeis.org

0, 0, 0, 0, 4, 0, 0, 0, 8, 8, 8, 0, 12, 0, 0, 0, 16, 16, 16, 16, 20, 16, 16, 0, 24, 24, 24, 0, 28, 0, 0, 0, 32, 32, 32, 32, 36, 32, 32, 32, 40, 40, 40, 32, 44, 32, 32, 0, 48, 48, 48, 48, 52, 48, 48, 0, 56, 56, 56, 0, 60, 0, 0, 0, 64, 64, 64, 64, 68, 64, 64, 64
Offset: 0

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

We only consider runs of consecutive 1's that completely match in binary expansions of n and n+1, not simply single common 1's.

Examples

			For n = 42:
- the binary expansion of 42 is "101010",
- the binary expansion of 43 is "101011",
- the first two runs of 1's are the same, the others differ,
- so the binary expansion of a(42) is "101000",
- and a(42) = 40.
		

Crossrefs

Programs

  • PARI
    A352724(n) = { my (r=[], o=0); while (n, my (v=valuation(n+n%2, 2)); if (n%2, r=concat(r, (2^v-1)*2^o)); o+=v; n\=2^v); r }
    a(n) = vecsum(setintersect(A352724(n), A352724(n+1)))

Formula

a(n) = A352727(n, n+1).

A352725 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, the binary expansions of a(n) and a(n+1) have no common runs of consecutive 1's.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

This sequence is a variant of A109812; here we consider runs of consecutive 1's, there individual 1's in binary expansions.
The binary expansions of two consecutive terms may share some 1's, but cannot have a common run of consecutive 1's (as given by A352724).

Examples

			The first terms, alongside the corresponding partitions into runs of 1's, are:
  n   a(n)  runs in a(n)
  --  ----  ------------
   0     0  []
   1     1  [1]
   2     2  [2]
   3     3  [3]
   4     4  [4]
   5     6  [6]
   6     5  [1, 4]
   7     7  [7]
   8     8  [8]
   9    12  [12]
  10     9  [1, 8]
  11    14  [14]
  12    10  [2, 8]
  13    13  [1, 12]
  14    11  [3, 8]
  15    15  [15]
  16    16  [16]
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-4 of 4 results.