login
Lexicographically earliest sequence of distinct positive integers such that all black pixels in the binary plot of the sequence are connected (see Comments for details).
3

%I #21 Feb 28 2023 09:03:42

%S 1,3,2,6,4,5,7,9,11,10,14,8,12,13,15,17,19,18,22,20,21,23,25,27,26,30,

%T 16,24,28,29,31,33,35,34,38,36,37,39,41,43,42,46,40,44,45,47,49,51,50,

%U 54,52,53,55,57,59,58,62,32,48,56,60,61,63,65,67,66,70

%N Lexicographically earliest sequence of distinct positive integers such that all black pixels in the binary plot of the sequence are connected (see Comments for details).

%C For any n, m, i, j such that a(n) AND (2^i) <> 0, and a(m) AND (2^j) <>0 (where AND stands for the bitwise AND operator), there exist two sequences of finite length L, say p and b, such that:

%C (1) p(1)=n, b(1)=i,

%C (2) p(L)=m, b(L)=j,

%C (3) a(p(k)) AND (2^b(k)) <> 0 for any k between 1 and L,

%C (4) |p(k+1)-p(k)| + |b(k+1)-b(k)| = 1 for any k between 1 and L-1.

%C These two finite sequences define a path of black pixels connecting the black pixels at positions (n,i) and (m,j).

%H Paul Tek, <a href="/A230598/b230598.txt">Table of n, a(n) for n = 1..10000</a>

%H Paul Tek, <a href="/A230598/a230598.png">Binary plot of the first 127 terms</a>

%H Paul Tek, <a href="/A230598/a230598.txt">PERL program for this sequence</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BinaryPlot.html">Binary Plot</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F Empirically, for any k>2 :

%F (1) a(2^k-1) = 2^k-1,

%F (2) a(2^k) = 2^k+1,

%F (3) a(n) = a(n-2^k+1) + 2^k, for any n such that 2^k<=n<2^(k+1)-(k+1),

%F (4) a(n) = 2^k, for n=2^(k+1)-(k+1),

%F (5) a(n) = a(n-2^k) + 2^k, for any n such that 2^(k+1)-(k+1)<n<2^(k+1).

%o (Perl) See Link section.

%Y Cf. A226077, A230599.

%K nonn,base,nice

%O 1,2

%A _Paul Tek_, Oct 24 2013