# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a209642 Showing 1-1 of 1 %I A209642 #19 Apr 30 2021 07:53:47 %S A209642 0,2,10,12,42,50,52,56,170,202,210,226,212,228,232,240,682,810,842, %T A209642 906,850,914,930,962,852,916,932,964,936,968,976,992,2730,3242,3370, %U A209642 3626,3402,3658,3722,3850,3410,3666,3730,3858,3746,3874,3906,3970,3412,3668,3732,3860,3748,3876,3908,3972,3752,3880,3912,3976,3920,3984,4000,4032 %N A209642 A014486-codes for rooted plane trees where non-leaf branching can occur only at the leftmost branch of any level, but nowhere else. Reflected from the corresponding rightward branching codes in A071162, thus not in ascending order. %C A209642 Like with A071162, a(n) can be computed directly from the binary expansion of n. (See the Scheme function given). However, the function is not monotone. A209641 gives the same terms in ascending order. %H A209642 Antti Karttunen, Table of n, a(n) for n = 0..32767 %F A209642 a(n) = A056539(A071162(n)) = A036044(A071162(n)). (See also the given Scheme-function). %o A209642 (Scheme) (define (A209642 n) (let loop ((n n) (s 0) (i 1)) (cond ((zero? n) s) ((even? n) (loop (/ n 2) (+ (* 4 s) 1) (* i 4))) (else (loop (/ (- n 1) 2) (* 2 (+ s i)) (* i 4)))))) %o A209642 (Python) %o A209642 def a(n): %o A209642 s=0 %o A209642 i=1 %o A209642 while n!=0: %o A209642 if n%2==0: %o A209642 n//=2 %o A209642 s=4*s + 1 %o A209642 else: %o A209642 n=(n - 1)//2 %o A209642 s=(s + i)*2 %o A209642 i*=4 %o A209642 return s %o A209642 print([a(n) for n in range(101)]) # _Indranil Ghosh_, May 25 2017, translated from _Antti Karttunen_'s SCHEME code %Y A209642 a(n) = A209641(A209861(n)). %K A209642 nonn,easy %O A209642 0,2 %A A209642 _Antti Karttunen_, Mar 11 2012 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE