# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a183079 Showing 1-1 of 1 %I A183079 #30 Sep 09 2017 19:39:36 %S A183079 1,2,3,4,6,5,10,7,21,9,15,8,55,14,28,11,231,27,45,13,120,20,36,12, %T A183079 1540,65,105,19,406,35,66,16,26796,252,378,34,1035,54,91,18,7260,135, %U A183079 210,26,666,44,78,17,1186570,1595,2145,76,5565,119,190,25,82621,434 %N A183079 Tree generated by the triangular numbers: a(1) = 1; a(2n) = nontriangular(a(n)), a(2n+1) = triangular(a(n+1)), where triangular = A000217, nontriangular = A014132. %C A183079 A permutation of the positive integers. %C A183079 In general, suppose that L and U are complementary sequences of positive integers such that %C A183079 (1) L(1)=1; and %C A183079 (2) if n>1, then n=L(k) or n=U(k) for some k=2. %C A183079 The numbers, taken in the order generated, form a permutation of the positive integers. %H A183079 Reinhard Zumkeller, Rows n = 1..14 of triangle, flattened %H A183079 Index entries for sequences that are permutations of the natural numbers %F A183079 Let L(n) be the n-th triangular number (A000217). %F A183079 Let U(n) be the n-th non-triangular number (A014132). %F A183079 The tree-array T(n,k) is then given by rows: %F A183079 T(0,0)=1; T(1,0)=2; %F A183079 T(n,2j)=L(T(n-1,j)); %F A183079 T(n,2j+1)=U(T(n-1,j)); %F A183079 for j=0,1,...,2^(n-1)-1, n>=2. %F A183079 a(1) = 1; after which: a(2n) = A014132(a(n)), a(2n+1) = A000217(a(n+1)). - _Antti Karttunen_, May 20 2015 %e A183079 First levels of the tree: %e A183079 1 %e A183079 | %e A183079 ...................2................... %e A183079 3 4 %e A183079 6......../ \........5 10......./ \........7 %e A183079 / \ / \ / \ / \ %e A183079 / \ / \ / \ / \ %e A183079 / \ / \ / \ / \ %e A183079 21 9 15 8 55 14 28 11 %e A183079 231 27 45 13 120 20 36 12 1540 65 105 19 406 35 66 16 %e A183079 Beginning with 3 and 4, the numbers are generated in pairs, such as (3,4), (6,5), (10,7), (21,9),... %e A183079 In all such pairs, the first number belongs to A000217; the second, to A014132. %t A183079 tr[n_]:=n*(n+1)/2; nt[n_]:= n+Round@ Sqrt[2*n];a[1]=1; a[n_Integer] := a[n] = If[ EvenQ@n, nt@a[n/2], tr@ a@ Ceiling[n/2]]; a/@Range[58] (* _Giovanni Resta_, May 20 2015 *) %o A183079 (Haskell) %o A183079 a183079 n k = a183079_tabf !! (n-1) !! (k-1) %o A183079 a183079_row n = a183079_tabf !! n %o A183079 a183079_tabf = [1] : iterate (\row -> concatMap f row) [2] %o A183079 where f x = [a000217 x, a014132 x] %o A183079 a183079_list = concat a183079_tabf %o A183079 -- _Reinhard Zumkeller_, Dec 12 2012 %o A183079 (Scheme, with memoizing definec-macro) %o A183079 (definec (A183079 n) (cond ((<= n 1) n) ((even? n) (A014132 (A183079 (/ n 2)))) (else (A000217 (A183079 (/ (+ n 1) 2)))))) %o A183079 ;; _Antti Karttunen_, May 18 2015 %Y A183079 Cf. A000217, A014132, A074049. %Y A183079 Cf. A220347 (inverse), A220348. %Y A183079 Cf. A183089, A183209 (similar permutations), also A257798. %K A183079 nonn,tabf %O A183079 1,2 %A A183079 _Clark Kimberling_, Dec 23 2010 %E A183079 Formula added to the name and a new tree illustration to the Example section by _Antti Karttunen_, May 20 2015 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE