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.

A338824 Lexicographically earliest sequence of nonnegative 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).

This page as a plain text file.
%I A338824 #11 Nov 13 2020 14:21:17
%S A338824 0,0,1,2,0,4,1,6,0,8,1,10,0,12,1,14,0,16,1,18,0,20,1,22,0,24,1,26,0,
%T A338824 28,1,30,0,32,1,34,0,36,1,38,0,40,1,42,0,44,1,46,0,48,1,50,0,52,1,54,
%U A338824 0,56,1,58,0,60,1,62,0,64,1,66,0,68,1,70,0,72,1,74
%N A338824 Lexicographically earliest sequence of nonnegative 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).
%H A338824 Rémy Sigrist, <a href="/A338824/a338824.txt">C program for A338824</a>
%F A338824 a(2*n) = 2*n-2 for any n > 0.
%F A338824 a(4*n+1) = 0 for any n >= 0.
%F A338824 a(4*n+3) = 1 for any n >= 0.
%F A338824 a(n) OR a(n+1) = A116966(n-2) for any n > 1.
%e A338824 The first terms, alongside a(n) OR a(n+1), are:
%e A338824   n   a(n)  a(n) OR a(n+1)
%e A338824   --  ----  --------------
%e A338824    1     0               0
%e A338824    2     0               1
%e A338824    3     1               3
%e A338824    4     2               2
%e A338824    5     0               4
%e A338824    6     4               5
%e A338824    7     1               7
%e A338824    8     6               6
%e A338824    9     0               8
%e A338824   10     8               9
%e A338824   11     1              11
%e A338824   12    10              10
%t A338824 Block[{a = {0, 0}, b = {0}}, Do[Block[{k = 0, 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 *)
%o A338824 (C) See Links section.
%Y A338824 Cf. A116966, A338823.
%K A338824 nonn,base
%O A338824 1,4
%A A338824 _Rémy Sigrist_, Nov 11 2020