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

A354169 a(0) = 0, a(1) = 1, a(2) = 2; for k >= 2, given a(k), the sequence is extended by adjoining two terms: a(2*k-1) = smallest m >= 0 not among a(0) .. a(k) such that {m, a(k), a(k+1), ..., a(2*k-2)} are pairwise disjoint in binary, and a(2*k) = smallest m >= 0 not among a(0) .. a(k) such that {m, a(k), ..., a(2*k-1)} are pairwise disjoint in binary.

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 16, 32, 64, 12, 128, 256, 512, 17, 1024, 34, 2048, 4096, 8192, 68, 16384, 136, 32768, 65536, 131072, 768, 262144, 524288, 1048576, 1025, 2097152, 18, 4194304, 2080, 8388608, 16777216, 33554432, 12288, 67108864, 134217728, 268435456, 16388
Offset: 0

Views

Author

N. J. A. Sloane, Jun 05 2022

Keywords

Comments

The paper by De Vlieger et al. (2022) calls this the "binary two-up sequence".
"Pairwise disjoint in binary" means no common 1-bits in their binary representations.
This is a set-theory analog of A090252. It bears the same relation to A090252 as A252867 does to A098550, A353708 to A121216, A353712 to A347113, etc.
A consequence of the definition, and also an equivalent definition, is that this is the lexicographically earliest infinite sequence of distinct nonnegative numbers with the property that the binary representation of a(n) is disjoint from (has no common 1's with) the binary representations of the following n terms.
An equivalent definition is that a(n) is the smallest nonnegative number that is disjoint (in its binary representation) from each of the previous floor(n/2) terms.
For the subsequence 0, 3, 12, 17, 34, ... of the terms that are not powers of 2 see A354680 and A354798.
All terms are the sum of at most two powers of 2 (see De Vlieger et al., 2022). - N. J. A. Sloane, Aug 29 2022

Examples

			After a(2) = 2 = 10_2, a(3) must equal ?0?_2, and the smallest such number we have not seen is a(3) = 100_2 = 4, and a(4) must equal ?00?_2, and the smallest such number we have not seen is a(4) = 1000_2 = 8.
		

Crossrefs

A355889 is a more efficient way to present this sequence.

Programs

Extensions

More terms from Rémy Sigrist, Jun 06 2022

A354773 For terms of A354169 that are the sum of two distinct powers of 2, the exponent of the smaller power of 2.

Original entry on oeis.org

0, 2, 0, 1, 2, 3, 8, 0, 1, 5, 12, 2, 3, 7, 16, 8, 9, 0, 10, 1, 4, 11, 24, 12, 13, 2, 14, 3, 6, 15, 32, 16, 17, 8, 18, 9, 19, 0, 20, 10, 21, 1, 22, 4, 5, 11, 48, 24, 25, 12, 26, 13, 27, 2, 28, 14, 29, 3, 30, 6, 7, 15, 64, 32, 33, 16, 34, 17, 35, 8, 36, 18, 37, 9, 38, 19, 39, 0, 40, 20, 41, 10, 42, 21, 43, 1, 44, 22, 45, 4, 46
Offset: 1

Views

Author

N. J. A. Sloane, Jun 26 2022

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import deque
    from functools import reduce
    from operator import or_
    def A354773_gen(): # generator of terms
        aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False
        while True:
            for k in count(1):
                m, j, j2, r, s = 0, 0, 1, b, k
                while r > 0:
                    r, q = divmod(r,2)
                    if not q:
                        s, y = divmod(s,2)
                        m += y*j2
                    j += 1
                    j2 *= 2
                if s > 0:
                    m += s*2**b.bit_length()
                if m not in aset:
                    if (s := bin(m)[:1:-1]).count('1') == 2:
                        yield s.index('1')
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = reduce(or_,aqueue)
                    f = not f
                    break
    A354773_list = list(islice(A354773_gen(),20)) # Chai Wah Wu, Jun 26 2022
    (C++) See Links section.

Formula

Conjecture from N. J. A. Sloane, Jun 29 2022: (Start)
The following is a conjectured recurrence for a(n). Basically a(n) = a(n/2-1) if n is even, and a(n) = (n+1)/2 if n is odd, except that there are four types of n which have a different formula, and there are 19 exceptional values for small n. Note that a(n) does not depend on earlier values when n is odd.
Here is the formula, which agrees with the first 10000 terms.
There are exceptional values as far out as n=61, so we take care of them first.
Initial conditons:
If n is on the list
[1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 15, 21, 22, 29, 30, 45, 61]
then a(n) is given by the n-th term of the following list:
[0, 2, 0, 1, 2, 3, 8, 0, 1, 5, 12, 2, 3, 7, 16, 8, 9, 0, 10,
1, 4, 11, 24, 12, 13, 2, 14, 3, 6, 15, 32, 16, 17, 8, 18, 9,
19, 0, 20, 10, 21, 1, 22, 4, 5, 11, 48, 24, 25, 12, 26, 13,
27, 2, 28, 14, 29, 3, 30, 6, 7].
Otherwise, if n is even, a(n) = a(n/2-1).
Otherwise n is odd and is not one of the exceptions.
(I) If n = 3*2^k-3, k >= 5, then a(n) = (n-1)/4.
(II) If n = 2^k-3, k >= 4 then a(n) = (n-1)/4.
(III) If n = 3*2^k-1, k >= 2 then a(n) = n+1.
(IV) If n = 2^k-1, k >= 3 then a(n) = n+1.
(V) Otherwise a(n) = (n+1)/2.
(End)
The conjecture is now known to be true. See De Vlieger et al. (2022). - N. J. A. Sloane, Aug 29 2022

A354774 For terms of A354169 that are the sum of two distinct powers of 2, the exponent of the larger power of 2.

Original entry on oeis.org

1, 3, 4, 5, 6, 7, 9, 10, 4, 11, 13, 14, 6, 15, 17, 18, 19, 20, 21, 22, 5, 23, 25, 26, 27, 28, 29, 30, 7, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 23, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 31, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86
Offset: 1

Views

Author

N. J. A. Sloane, Jun 26 2022

Keywords

Comments

Taking first differences, then applying the RUNS transform gives [1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 13, 1, 1, 1, 13, 1, 1, 1, 29, 1, 1, 1, 29, 1, 1, 1, 61, 1, 1, 1, 61, 1, 1, 1, 125, 1, 1, 1, 125, 1, 1, 1, 253, 1, 1, 1, 253, 1, 1, 1, 509, ...].
If the initial 4 is changed to a 1, this has an obvious regular structure, which could then be analyzed to give a conjectured generating function, just as was done for A354767. See link below.
A more precise conjecture is given in the Formula section.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import deque
    from functools import reduce
    from operator import or_
    def A354774_gen(): # generator of terms
        aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False
        while True:
            for k in count(1):
                m, j, j2, r, s = 0, 0, 1, b, k
                while r > 0:
                    r, q = divmod(r,2)
                    if not q:
                        s, y = divmod(s,2)
                        m += y*j2
                    j += 1
                    j2 *= 2
                if s > 0:
                    m += s*2**b.bit_length()
                if m not in aset:
                    if (s := bin(m)[3:]).count('1') == 1:
                        yield len(s)
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = reduce(or_,aqueue)
                    f = not f
                    break
    A354774_list = list(islice(A354774_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

Conjecture from N. J. A. Sloane, Jun 29 2022: (Start)
The following is a conjectured explicit formula for a(n). Basically a(n) = n+2, except that there are four types of n which have a different formula, and there are 6 exceptional values for small n.
Here is the formula, which agrees with the first 10000 terms.
(I) If n = 3*2^(k-1)-3, k >= 2 then a(n) = (n+1)/2, except a(3) = a(9) = 4 and a(21) = 5.
(II) If n = 2^(k+1)-3, k >= 1 then a(n) = (n+1)/2, except a(5) = a(13) = 6 and a(29) = 7.
(III) If n = 3*2^(k-1)-2, k >= 2 then a(n) = n+1.
(IV) If n = 2^(k+1)-2, k >= 1 then a(n) = n+1.
(V) Otherwise a(n) = n+2. (End)
The conjecture is now known to be true. See De Vlieger et al. (2022). - N. J. A. Sloane, Aug 29 2022
Showing 1-3 of 3 results.