|
|
A258009
|
|
If n <= 16, a(n) = n; for n > 16: a(16n + 6) = 16*n + 9, and for other cases with n > 16: a(2n) = 2*a(n), a(2n+1) = 2*a(n) + 1.
|
|
3
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 41, 39, 40, 41, 42, 43, 50, 51, 46, 47, 48, 49, 50, 51, 52, 53, 57, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 71, 72, 73, 74, 75, 82, 83, 78, 79, 80, 81, 82, 83, 84, 85, 89, 87, 100
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Function a(n) rewrites in the binary representation of n the rightmost occurrence of substring "0110" to "1001", provided at least one such substring is present, otherwise fixes n.
The values 224694 and 486838 shown in the example section are capless and one-capped binary boundary codes for seven-hex polyhex-configuration called "crown" (the name employed for example in Guo et al paper) and the resulting values are the respective codes for one hex smaller polyhexes. The crown is one of the polyhexes that are too round that the related recurrence A254109 could make any dent in their boundary. Together with the latter can be used to obtain the terms of A258012, please see comments there.
|
|
LINKS
|
|
|
FORMULA
|
If n <= 16, a(n) = n; for n > 16: a(16n + 6) = 16*n + 9, and for other cases with n > 16: a(2n) = 2*a(n), a(2n+1) = 2*a(n) + 1.
|
|
EXAMPLE
|
For n = 224694 ("110110110110110110" in binary) we rewrite the rightmost "0110" to "1001" resulting "110110110110111001" in binary, which is 224697 in decimal, thus a(224694) = 224697.
For n = 486838 ("1110110110110110110" in binary) we rewrite the rightmost "0110" to "1001" resulting "1110110110110111001" in binary, which is 486841 in decimal, thus a(486838) = 486841.
|
|
PROG
|
(Scheme, two variants, the first one utilizing a memoizing definec-macro)
(definec (A258009 n) (cond ((<= n 16) n) ((= 6 (modulo n 16)) (+ 9 (* 16 (floor->exact (/ n 16))))) (else (+ (modulo n 2) (* 2 (A258009 (floor->exact (/ n 2))))))))
;; Faster, iterative version:
(define (A258009 n) (let loop ((n n) (s 0) (p2 1)) (cond ((<= n 16) (+ (* p2 n) s)) ((= 6 (modulo n 16)) (+ (* p2 16 (floor->exact (/ n 16))) s (* p2 9))) ((even? n) (loop (/ n 2) s (+ p2 p2))) (else (loop (/ (- n 1) 2) (+ s p2) (+ p2 p2))))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|