|
|
A338823
|
|
Lexicographically earliest sequence of positive integers such that for any distinct m and n, a(m) OR a(m+1) <> a(n) OR a(n+1) (where OR denotes the bitwise OR operator).
|
|
2
|
|
|
1, 1, 2, 2, 4, 1, 6, 8, 1, 10, 2, 13, 1, 16, 2, 17, 4, 4, 8, 8, 16, 4, 18, 5, 24, 1, 26, 2, 28, 3, 32, 1, 36, 2, 32, 4, 24, 32, 7, 40, 1, 42, 2, 44, 1, 48, 2, 49, 4, 40, 8, 49, 6, 48, 4, 56, 2, 57, 4, 58, 5, 64, 1, 66, 2, 68, 3, 72, 1, 76, 2, 72, 4, 64, 8, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
The first terms, alongside a(n) OR a(n+1), are:
n a(n) a(n) OR a(n+1)
-- ---- --------------
1 1 1
2 1 3
3 2 2
4 2 6
5 4 5
6 1 7
7 6 14
8 8 9
9 1 11
10 10 10
11 2 15
12 13 13
|
|
MATHEMATICA
|
Block[{a = {1, 1}, b = {1}}, Do[Block[{k = 1, m}, While[! FreeQ[b, Set[m, BitOr @@ {a[[-1]], k}]], k++]; AppendTo[a, k]; AppendTo[b, m]], {i, 3, 76}]; a] (* Michael De Vlieger, Nov 12 2020 *)
|
|
PROG
|
(C) See Links section.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|