OFFSET
0,3
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
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..4941
Michael De Vlieger, Thomas Scheuerle, Rémy Sigrist, N. J. A. Sloane, and Walter Trump, The Binary Two-Up Sequence, arXiv:2209.04108 [math.CO], Sep 11 2022.
Rémy Sigrist, PARI program
N. J. A. Sloane, Construction of terms a(0) through a(18)
N. J. A. Sloane, Table showing first 190 terms (pdf file of scan of large table)
N. J. A. Sloane, Left-hand portion of rows 97-135 of preceding table, showing columns 67-96, rotated counter-clockwise by 90 degrees. The red line in this table should be aligned with the red line between rows 135 and 136 in the preceding table. [This portion of the table was too wide to fit through the scanner.]
N. J. A. Sloane, Blog post about the Two-Up sequence, June 13 2022. Mentions this sequence.
N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 16.
EXAMPLE
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.
MATHEMATICA
nn = 42; c[_] = r = 0; m = 1; Array[Set[{a[#], c[#]}, {#, #}] &, 2, 0]; Do[k = SelectFirst[Union@ Map[Total, Rest@ Subsets[2^Reverse[Length[#] - Position[#, 1][[All, 1]]] &@ IntegerDigits[2^(r + 2) - m - 1, 2]]], c[#] == 0 &]; Set[{a[n], c[k]}, {k, n}]; m += a[n]; If[And[IntegerQ[#], # > 0], m -= a[#]] &[n/2]; If[And[EvenQ[k], PrimePowerQ[k], k > 2^r], r++], {n, 2, nn}]; Table[a[n], {n, 0, nn}] (* Michael De Vlieger, Jul 13 2022 *)
PROG
(PARI) See Links section.
(Python)
from itertools import count, islice
from collections import deque
from functools import reduce
from operator import or_
def A354169_gen(): # generator of terms
aset, aqueue, b, f = {0, 1, 2}, deque([2]), 2, False
yield from (0, 1, 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:
yield m
aset.add(m)
aqueue.append(m)
if f: aqueue.popleft()
b = reduce(or_, aqueue)
f = not f
break
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jun 05 2022
EXTENSIONS
More terms from Rémy Sigrist, Jun 06 2022
STATUS
approved