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-10 of 10 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

A354680 Terms of A354169 that are not powers of 2, in order of appearance.

Original entry on oeis.org

0, 3, 12, 17, 34, 68, 136, 768, 1025, 18, 2080, 12288, 16388, 72, 32896, 196608, 262400, 524800, 1048577, 2098176, 4194306, 48, 8390656, 50331648, 67112960, 134225920, 268435460, 536887296, 1073741832, 192, 2147516416, 12884901888, 17179934720, 34359869440
Offset: 1

Views

Author

Rémy Sigrist and N. J. A. Sloane, Jun 06 2022

Keywords

Comments

Apart from the initial 0, all terms have Hamming weight 2. See De Vlieger et al. (2022). - N. J. A. Sloane, Aug 29 2022

Examples

			The initial terms of A354169 are:
  0, 1, 2, 4, 8, 3, 16, 32, 64, 12, 128, 256.
The initial terms of this sequence are therefore: 0,             3,             12.
and the initial terms of A354798 are
  0,             5,              9.
		

Crossrefs

Cf. A000120, A057716, A354169, A354798 (corresponding indices).
See also A354767.

Programs

  • PARI
    See Links section.
    (Python 3.10+)
    from itertools import count, islice
    from collections import deque
    from functools import reduce
    from operator import or_
    def A354680_gen(): # generator of terms
        aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False
        yield 0
        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 m.bit_count() > 1:
                        yield m
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = reduce(or_,aqueue)
                    f = not f
                    break
    A354680_list = list(islice(A354680_gen(),40)) # Chai Wah Wu, Jun 06 2022

Formula

A000120(A354169(a(n))) <> 1.

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

A355150 The Hamming weight of A354169, a(n) = A000120(A354169(n)).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1
Offset: 0

Views

Author

Thomas Scheuerle, Jun 21 2022

Keywords

Comments

All the following conjectures are now known to be true. See De Vlieger et al. (2022). - N. J. A. Sloane, Aug 29 2022
Conjecture: It appears that this sequence may be computed by a fast algorithm:
We begin with an initial sequence 0,1,1,1,1,2. Let n be the index of the last element added. Then extend by the rules:
If a(n) = 2, a((n-3)/2) = 1, and a((n-1)/2) = 2 extend this sequence by 1,2.
If a(n) = 2, a((n-3)/2) = 2, a((n-1)/2) = 1, and a(n-2) = 1, extend this sequence by 1,2.
In all other cases extend this sequence by 1,1,1,2.
This conjecture was verified for n = 0..2^16 against the b-file provided by Michael De Vlieger. - Thomas Scheuerle, Jul 14 2022
[Typos corrected by N. J. A. Sloane, Jul 10 2022 at the suggestion of Michel Dekking.]
From Michel Dekking, Jul 12 2022: (Start)
Conjecture: It appears that this sequence is almost a periodic sequence, with period 6. Let x be the sequence defined below.
If n > 25, n == 2 (mod 6) is not an element of x then (written as words)
a(n)a(n+1)...a(n+5) = 111212.
If n > 25, n == 2 (mod 6) is an element of x then
a(n)a(n+1)...a(n+5) = 121112.
The sequence x = {32, 44, 68, 92, 140, 188, 284, ...} is a sparse sequence defined via the sequence A007283, given by A007283(n)=3*2^n, which has also been encountered in A354169. In fact, x(1) = 32, and
x(2n+2) - x(2n+1) = 3*2^(n+2) for n=0,1,2,....
x(2n+1) - x(2n) = 3*2^(n+2) for n=1,2,.... (End)
From Michel Dekking, Jul 23 2022: (Start)
Extending the sequence x to the right with the four numbers 5,8,14,21 we obtain sequence A354789.
So the sparse positions are given by 9*2^k - 4 for k even, and by 12*2^k - 4 for k odd, for k = 2,3,... (End)

Crossrefs

Programs

  • MATLAB
    function a = A355150( max_n ) % Note: a(0) is omitted here because
                                  % a(1) will be a(1) in the sequence.
        a = [1 1 1 1 2];
        m = length(a);
        while length(a) < max_n
            if (((a((m-3)/2) == 2)&&(a((m-1)/2) == 1)&&(a(m-2) == 1)) ...
                ||((a((m-3)/2) == 1)&&(a((m-1)/2) == 2)))
                a(m+1:m+2) = [1 2];
                m = m+2;
            else
                a(m+1:m+4) = [1 1 1 2];
                m = m+4;
            end
        end
    end

Formula

a(A354767(n)) = 1.
a(A354798(n+1)) != 2.

Extensions

Edited by N. J. A. Sloane, Jul 10 2022

A354780 a(n) is the bitwise OR of (the binary expansions of) b(n+1) to b(2*n), where b is A354169.

Original entry on oeis.org

2, 12, 27, 115, 252, 1004, 2013, 4031, 16307, 32631, 65279, 261375, 524270, 2096110, 4194253, 8386527, 16773119, 67096575, 134217659, 536854459, 1073741623, 2147450751, 4294901759, 17179672575, 34359737599, 137438690559, 274877382143, 549754765311, 2199022205950, 4398044412927, 8796093022189, 35184367894509, 70368744175567
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2022

Keywords

Comments

If the binary expansion of a(n) has a 1 in the 2^i's bit (for any i >= 0) then A354169(2*n+1) must have a 0 in that bit.
A354169(2*n+1) is the smallest number not yet in A354169 which satisfies that condition (this follows at once from the definition of A354169).
This sequence bears the same relation to A354169 as A355057 does to A090252.

Examples

			Consider n=6. Then b(7) to b(12) are 32, 64, 12, 128, 256, 512. The bitwise OR of those 6 numbers is 1111101100_2 = 1004_10 = a(6). The bitwise complement of 1004_10 is 10011_2 = 19_10 = A354781(6), and A354169(6) = 17_10 = 10001_2.
On the other hand, for n=5, b(6) to b(10) are 16, 32, 64, 12, 128, whose bitwise OR is 11111100_2 = 252_10 = a(5). The bitwise complement of 252_10 is 3_10 = 11_2 = A354781(5). However, 3 has already appeared in A354169, and the smallest available number whose binary expansion is disjoint from 252_10 = 11111100_2 is 2^8 = 100000000_2 = 256_10 = 2^8 = A354169(5).
		

Crossrefs

A354775 Indices where A354169 is the sum of two consecutive powers of 2.

Original entry on oeis.org

5, 9, 25, 37, 49, 67, 73, 91, 97, 145, 193, 289, 385, 577, 769, 1153, 1537, 2305, 3073, 4609, 6145, 9217, 12289, 18433, 24577, 36865, 49153, 73729, 98305, 147457, 196609, 294913, 393217, 589825, 786433, 1179649, 1572865, 2359297, 3145729, 4718593, 6291457
Offset: 1

Views

Author

N. J. A. Sloane, Jun 26 2022

Keywords

Comments

A subsequence of A354798.
The first differences begin 4, 16, 12, 12, 18, 6, 18, 6, 48, 48, 96, 96, 192, 192, 384, 384, 768, 768, 1536, ..., which suggests that from the 9th term on, the differences have g.f. 48*(1+x)/(1-2*x^2), with an analogous conjecture for the sequence itself.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import deque
    from functools import reduce
    from operator import or_
    def A354775_gen(): # generator of terms
        aset, aqueue, b, f, i = {0,1,2}, deque([2]), 2, False, 2
        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:
                    i += 1
                    if '11' in (s := bin(m)[2:]) and s.count('1') == 2:
                        yield i
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = reduce(or_,aqueue)
                    f = not f
                    break
    A354775_list = list(islice(A354775_gen(),15)) # Chai Wah Wu, Jun 27 2022

Extensions

More terms from Rémy Sigrist, Jun 27 2022

A354781 If the binary expansion of A354780(n) is 1 d_1 d_2 ... d_k, then the binary expansion of a(n) is c_1 c_2 ... c_k, where c_i = 1 - d_i.

Original entry on oeis.org

1, 3, 4, 12, 3, 19, 34, 64, 76, 136, 256, 768, 17, 1041, 50, 2080, 4096, 12288, 68, 16452, 200, 32896, 65536, 196608, 768, 262912, 524800, 1048576, 1049601, 2098176, 18, 4194322, 2096, 8390656, 16777216, 50331648, 12288, 67121152, 134225920, 268435456, 268451844, 536887296, 72, 1073741896, 32960, 2147516416, 4294967296, 12884901888
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2022

Keywords

Examples

			See A354780.
		

Crossrefs

A355889 Concatenate the exponents of the powers of 2 in A354169(k) in increasing order, for k = 1, 2, 3, ...

Original entry on oeis.org

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

Views

Author

Rémy Sigrist and N. J. A. Sloane, Jul 20 2022

Keywords

Comments

It is conjectured that the Hamming weight of A354169(k) is always 0, 1, or 2. This is known to be true for at least the first 2^25 terms. (The present sequence is well-defined even if the conjecture is false.)
So this is a far more efficient way to present A354169 than by listing the decimal expansions.
The terms of A354169 that are pure powers of 2 appear in order, so it is obvious how to recover A354169 from this sequence.
This could be regarded as a table with (presumably) two columns, and could therefore have keyword "tabf", but that is not really appropriate, since basically it consists of the nonnegative integers with some interjections.

Examples

			A354169 begins 0, 1, 2, 4, 8, 3, 16, 32, 64, 12, 128, ... We ignore the initial 0, and then the binary expansions are 2^0, 2^1, 2^2, 2^3, 2^0+2^1, 2^4, 2^5, 2^6, 2^2+2^3, 2^7, ..., so the present sequence begins 0, 1, 2, 3, 0, 1, 4, 5, 6, 2, 3, 7, ...
		

Crossrefs

A354779 a(0), ..., a(5) are 0, 1, 2, 3, 3, 3; thereafter if n == 0 mod 4 then a(n) = n/2; if n == 1 mod 4, (n+1)/2; 2 mod 4, (n+2)/2; 3 mod 4, (n+1)/2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 01 2022

Keywords

Comments

Arises in the analysis of A354767.

Crossrefs

Cf. A354767.

Formula

G.f.: x*(x^7-x^6-x^3+x^2+1)/((1-x)^2*(1+x^2)).
Showing 1-10 of 10 results.