The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A255571 Numbers whose binary representation traces a nonselfcrossing circuit in honeycomb lattice when its bits (from the least to the second most significant bit) are interpreted as directions to proceed at each vertex. (The most significant 1-bit is ignored). 8
1, 64, 65, 126, 127, 1056, 1057, 1090, 1091, 1156, 1157, 1288, 1289, 1518, 1519, 1552, 1553, 1782, 1783, 1914, 1915, 1980, 1981, 2014, 2015, 4368, 4369, 4642, 4643, 5188, 5189, 6006, 6007, 6280, 6281, 7098, 7099, 7644, 7645, 7918, 7919, 16962, 16963, 17028, 17029, 17160, 17161, 17542, 17543, 17544, 17545, 17674, 17675, 17938, 17939 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Numbers n such that when we start scanning bits in the binary expansion of n, from the least to the most significant end, and when we interpret each bit as to a direction which to turn at each vertex (e.g., 0 = left, 1 = right) when traversing the edges of honeycomb lattice, then, when we have consumed all except the most significant 1-bit (which is ignored), we have eventually returned to the same vertex where we started from and none of the other vertices have been visited twice.
Indexing starts from zero, because a(0) = 1 is a special case, indicating an empty path, which thus ends at the same vertex as where it started from.
If n is a member, then A054429(n) is also a member.
LINKS
EXAMPLE
The examples given in A255570 occur also in this sequence, except that 380 ("101111100" in binary) is excluded from this sequence, because it visits twice the first vertex after the starting vertex.
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(define A255571 (MATCHING-POS 0 1 isA255571?))
(define (isA255571? n) (let loop ((n n) (x 0) (y 0) (phase 0) (vv (list))) (cond ((= 1 n) (and (zero? x) (zero? y))) ((member (cons x y) vv) #f) (else (let* ((d (modulo n 2)) (newphase (modulo (+ phase d d -1) 6))) (loop (/ (- n d) 2) (+ x (x-delta newphase)) (+ y (y-delta newphase)) newphase (cons (cons x y) vv)))))))
(define (newphase p d) (modulo (+ p d d -1) 6))
(define (x-delta phase) (* (- (* 2 (floor->exact (/ phase 3))) 1) (- (modulo phase 3) 1)))
(define (y-delta phase) (* (- 1 (* 2 (floor->exact (/ phase 3)))) (floor->exact (/ (+ 1 (modulo phase 3)) 2))))
CROSSREFS
Subsequence of A255570.
Sequence in context: A291094 A291965 A255570 * A151984 A194769 A217846
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 13 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 21:22 EDT 2024. Contains 372549 sequences. (Running on oeis4.)