login
A230598
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
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, 16, 24, 28, 29, 31, 33, 35, 34, 38, 36, 37, 39, 41, 43, 42, 46, 40, 44, 45, 47, 49, 51, 50, 54, 52, 53, 55, 57, 59, 58, 62, 32, 48, 56, 60, 61, 63, 65, 67, 66, 70
OFFSET
1,2
COMMENTS
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:
(1) p(1)=n, b(1)=i,
(2) p(L)=m, b(L)=j,
(3) a(p(k)) AND (2^b(k)) <> 0 for any k between 1 and L,
(4) |p(k+1)-p(k)| + |b(k+1)-b(k)| = 1 for any k between 1 and L-1.
These two finite sequences define a path of black pixels connecting the black pixels at positions (n,i) and (m,j).
FORMULA
Empirically, for any k>2 :
(1) a(2^k-1) = 2^k-1,
(2) a(2^k) = 2^k+1,
(3) a(n) = a(n-2^k+1) + 2^k, for any n such that 2^k<=n<2^(k+1)-(k+1),
(4) a(n) = 2^k, for n=2^(k+1)-(k+1),
(5) a(n) = a(n-2^k) + 2^k, for any n such that 2^(k+1)-(k+1)<n<2^(k+1).
PROG
(Perl) See Link section.
CROSSREFS
Sequence in context: A196047 A106409 A115510 * A245446 A070264 A365233
KEYWORD
nonn,base,nice
AUTHOR
Paul Tek, Oct 24 2013
STATUS
approved