login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, a(n) AND a(n + k) <> a(n + 2*k) (where AND denotes the bitwise AND operator).
2

%I #14 Aug 17 2018 12:43:37

%S 0,0,1,1,2,1,1,2,2,3,3,1,3,3,4,2,4,4,3,3,5,3,3,5,2,2,1,4,4,5,5,6,5,5,

%T 6,6,3,3,6,3,3,7,5,6,7,5,6,3,7,7,8,7,8,8,9,9,7,9,9,7,7,10,10,9,9,7,7,

%U 9,10,10,6,5,10,6,5,7,11,4,7,6,7,5,9,9,11

%N Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, a(n) AND a(n + k) <> a(n + 2*k) (where AND denotes the bitwise AND operator).

%C This sequence has similarities with A276204: here we consider the bitwise AND operator, there the addition operator.

%C Apparently, the variant where we use the bitwise OR operator corresponds, up to a change of offset, to A289814.

%C The scatterplot of the sequence has fractal features (see illustrations in Links section).

%H Rémy Sigrist, <a href="/A317805/b317805.txt">Table of n, a(n) for n = 1..10000</a>

%H Rémy Sigrist, <a href="/A317805/a317805.txt">C++ program for A317805</a>

%H Rémy Sigrist, <a href="/A317805/a317805.png">Scatterplot of the first 9000000 terms</a>

%H Rémy Sigrist, <a href="/A317805/a317805_1.png">Colored scatterplot of the first 9000000 terms</a> (where the color is function of the greatest p such that floor(a(n)/2^p) == 1 mod 4 and n + b(a(n)) >= 2 * b(ceil(n/2^p)*2^p) and b(k) is the least m such that a(m) = k)

%e For n = 10:

%e - a(10-2*1) AND a(10-1) = 2 AND 2 = 2,

%e - a(10-2*2) AND a(10-2) = 1 AND 2 = 0,

%e - a(10-2*3) AND a(10-3) = 1 AND 1 = 1,

%e - a(10-2*4) AND a(10-4) = 0 AND 1 = 0,

%e - hence a(10) = 3.

%o (C++) See Links section.

%Y Cf. A276204, A289814.

%K nonn,base,look

%O 1,5

%A _Rémy Sigrist_, Aug 07 2018