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.

A266195 Match-making permutation: start with a(1) = 1, then always choose for a(n) the least unused number such that multiplying a(n) by a(n-1) does not produce any carries when performed in base 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 12, 16, 11, 17, 13, 32, 14, 18, 20, 19, 33, 15, 34, 22, 64, 21, 24, 36, 28, 65, 23, 66, 25, 40, 35, 72, 42, 48, 37, 68, 26, 128, 27, 129, 29, 130, 30, 132, 31, 256, 38, 80, 49, 73, 56, 136, 41, 96, 69, 144, 67, 84, 97, 137, 112, 145, 134, 160, 50, 133, 76, 161, 100, 257, 39, 258, 43, 260, 44
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2015

Keywords

Comments

More formally: the lexicographically earliest injection of natural numbers such that for any n > 1, A061858(a(n), a(n-1)) = 0; a(1) = 1. By necessity also surjective on N (see below for why), thus a bijection.
Less formally:
In this context we say that two positive natural numbers x and y "match", when they will not produce any carries when multiplied in binary system (see the Examples). The purpose of this sequence is with a simple greedy algorithm to form pairs of natural numbers that "match to each other" according to that criterion. Note that each number after 1 will satisfy the matching condition both with its predecessor and its successor.
For the sake of this discussion, we call a natural number n "dense" if the density of 1-bits in its binary representation (cf., e.g., A265917) is over a certain threshold, whose exact value we leave undefined, but can be subjectively gauged. In contrast, we call a number "ethereal" if its base-2 representation consists mostly of zeros. E.g., 258 = 100000010_2 is clearly one of the "ethereals", while 43 = 101011_2, is definitely on the denser side.
When running the algorithm, we note that after a while, for long stretches of time, it mostly matches "dense" numbers with "ethereal" numbers, like 258 and 43, which occur next to each other in the sequence as a(76) and a(77), and also a(49)=31 and a(50)=256, which are the most dense and most ethereal members of their respective binary sizes (see the Example section).
Also, it should be obvious that each number of the form 2^k (terms of A000079, the "super-ethereals") occur as the first representative of the numbers of the same binary length, and any number of the form (2^k)-1 (A000225, "super-dense") comes as the last of the numbers of binary length k.
No matter how dense some number might look to us, there is always a sufficiently ethereal number with which it can be mated (that is, the algorithm is never stuck, because it can always try the next unused super-ethereal 2^k if everything else fails). Moreover, whenever that next 2^k has appeared, it also always immediately picks up from the backlog of (more or less dense) numbers the least unmatched number so far, which proves that no number is left out, and the sequence is indeed a permutation of the natural numbers.
However, certain numbers intuitively feel to be much better matches to each other, like 10 and 12 (cf. Examples), because they are not so distant from each other. We define "good matches" to be such pairs that the binary length (A070939) of the numbers is equal. As 10 and 12 are both four bits long, they are one instance of such a good match. Note that 10 is also a good match with the immediately preceding number in the sequence, 9 = 1001_2.
Sequence A266197 gives the positions of these good matches, and A265748 & A265749 give their first and second members respectively. It is an open question whether the algorithm generates an infinite number of good matches or not.

Examples

			For n=11, we first note that a(10) = 10, and the least unused number after a(1) .. a(10) is 11. Trying to multiply 10 (= 1010_2) and 11 (= 1011_2), in the binary system results in
     1011
  *  1010
  -------
   c1011
  1011
  -------
  1101110 = 110,
and we see that there's a carry-bit (marked c) affecting the result, thus A048720(10,11) < 10*11 and A061858(10,10) > 0, thus we cannot select 11 for a(11).
The next unused number is 12, and indeed, for numbers 10 and 12 (= 1100_2), the binary multiplication results in
     1100
  *  1010
  -------
    1100
  1100
  -------
  1111000 = 120,
which is a clean product without carries (i.e., A061858(10,12) = 0), thus 12 is selected to be a match for 10, and we set a(11) = 12.
For a(49) = 31 (= 11111_2) and a(50) = 256 (= 100000000_2) the multiplication results in
      100000000
    *     11111
  -------------
      100000000
     100000000
    100000000
   100000000
  100000000
  -------------
  1111100000000 = 7936,
and we see that the carryless product is this time obtained almost trivially, as the other number is so much larger and more spacious than the other that they can easily avoid any clashing bits that would produce carries.
		

Crossrefs

Inverse permutation: A266196.
Cf. A266194 (products of these pairs).
Cf. A266197 (indices of good matches),
Cf. A265748, A265749 (give the first and second members of good matches).
Cf. A266186 (when 2^n appears), A266187 (when (2^n)-1 appears).
Cf. A266191, A266351 (similar permutations).
Cf. also A235034, A235035.

A266186 a(n) = A266196(A000079(n)); indices of powers of 2 in A266195.

Original entry on oeis.org

1, 2, 4, 7, 12, 16, 25, 42, 50, 82, 104, 116, 201, 227, 243, 455, 477, 517, 1035, 1093, 1155, 1217, 2599, 2695, 4377, 4491, 4773, 4947, 5137, 13409, 13537, 14125, 14299, 14631, 15123, 34005, 34447, 34781, 36017, 36867, 37289, 37913, 155106, 155700, 157254
Offset: 0

Views

Author

Antti Karttunen, Dec 26 2015

Keywords

Comments

Very likely also the positions of records in A264982.

Crossrefs

Formula

a(n) = A266196(A000079(n)).

Extensions

More terms from Rémy Sigrist, Oct 04 2022

A266196 Inverse permutation to A266195.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 15, 17, 22, 12, 14, 18, 20, 19, 26, 24, 31, 27, 33, 41, 43, 29, 45, 47, 49, 16, 21, 23, 35, 28, 39, 51, 75, 34, 57, 37, 77, 79, 83, 81, 89, 38, 53, 69, 91, 85, 99, 101, 105, 55, 107, 103, 109, 87, 111, 113, 115, 25, 30, 32, 61, 40, 59, 93, 97, 36, 54, 117, 166, 71, 186, 192, 194, 52, 121
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2015

Keywords

Comments

a(n) tells the time-step when n appears in "the match-making permutation" A266195.

Crossrefs

Inverse: A266195.

A264982 Binary width of terms produced by match-making permutation: a(n) = A070939(A266195(n)).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 3, 4, 4, 4, 5, 4, 5, 4, 6, 4, 5, 5, 5, 6, 4, 6, 5, 7, 5, 5, 6, 5, 7, 5, 7, 5, 6, 6, 7, 6, 6, 6, 7, 5, 8, 5, 8, 5, 8, 5, 8, 5, 9, 6, 7, 6, 7, 6, 8, 6, 7, 7, 8, 7, 7, 7, 8, 7, 8, 8, 8, 6, 8, 7, 8, 7, 9, 6, 9, 6, 9, 6, 9, 6, 10, 6, 9, 6, 9, 6, 10, 6, 10, 6, 9, 7, 8, 7, 9, 7, 10, 6, 10, 6, 10, 6, 11, 6, 11, 6, 11, 6, 11, 6, 11, 6, 11, 6, 12, 7
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2015

Keywords

Comments

Each n occurs A000079(n-1) = 2^(n-1) times in total.

Crossrefs

Cf. A266186 (where n first appears, most likely also the positions of records).
Cf. A266187 (where n last appears).
Cf. A266197 (gives numbers n where a(n) = a(n+1)).

Programs

Formula

a(n) = A070939(A266195(n)).
Showing 1-4 of 4 results.