This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A258009 #12 Jun 11 2015 08:23:01 %S A258009 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, %T A258009 26,27,28,29,30,31,32,33,34,35,36,37,41,39,40,41,42,43,50,51,46,47,48, %U A258009 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 %N 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. %C A258009 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. %C A258009 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. %H A258009 Antti Karttunen, <a href="/A258009/b258009.txt">Table of n, a(n) for n = 0..8191</a> %H A258009 Guo, Hansen, Zheng, <a href="http://dx.doi.org/10.1016/S0166-218X(01)00180-9">Boundary uniqueness of fusenes</a>, Discrete Applied Mathematics 118 (2002), pp. 209-222. %F 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. %e A258009 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. %e A258009 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. %o A258009 (Scheme, two variants, the first one utilizing a memoizing definec-macro) %o A258009 (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)))))))) %o A258009 ;; Faster, iterative version: %o A258009 (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)))))) %Y A258009 Cf. A254109, A258012. %K A258009 nonn,base %O A258009 0,3 %A A258009 _Antti Karttunen_, May 31 2015