%I #72 Jul 25 2022 15:41:13
%S 1,2,1,3,4,2,5,1,6,3,7,8,4,9,2,10,5,11,1,12,6,13,3,14,7,15,16,8,17,4,
%T 18,9,19,2,20,10,21,5,22,11,23,1,24,12,25,6,26,13,27,3,28,14,29,7,30,
%U 15,31,32,16,33,8,34,17,35,4,36,18,37,9,38,19,39,2,40,20,41,10,42,21,43
%N Representation of a dense para-sequence.
%C A fractal sequence. The para-sequence may be regarded as a sort of "limit" of the concatenated segments. The para-sequence (itself not a sequence) is dense in the sense that every pair of terms i and j are separated by another term (and hence separated by infinitely many terms).
%C The para-sequence accounts for positions of dyadic rational numbers in the following way: Label 1/2 as 1; label 1/4, 3/4 as 2 and 3; label 1/8, 3/8, 5/8, 7/8 as 4,5,6,7, etc. Then, for example, the ordering 1/8 < 1/4 < 3/8 < 1/2 < 5/8 < 3/4 < 7/8 matches the labels 4,2,5,1,6,3,7, which is the 3rd segment of A131987. The n-th segment consists of labels for rationals having denominators 2, 4, 8, ..., 2^n.
%C Could be seen as a "fuzzy table" with row lengths 2^n-1. In row n one has the numbers, read from the leftmost to the rightmost, as they appear in a perfect binary tree of 2^n-1 nodes when inserted in "storage order" into the tree, cf. illustration in A101279 and stackexchange link. These rows are obviously permutations of [1..2^n-1], their inverse is given in A269752. - _M. F. Hasler_, Mar 04 2016
%C Subsequence of A025480 (omitting all terms=0). - _David James Sycamore_, Apr 26 2020
%C The sequence obtained by adding 1 to every term of this sequence is the same as A003602 with all 1's removed. - _David James Sycamore_, Jul 25 2022
%D C. Kimberling, Proper self-containing sequences, fractal sequences and para-sequences, preprint, 2007.
%H Clark Kimberling, <a href="/A131987/b131987.txt">Table of n, a(n) for n = 1..10000</a>
%H Josef Eschgfäller, Andrea Scarpante, <a href="http://arxiv.org/abs/1603.08500">Dichotomic random number generators</a>, arXiv:1603.08500 [math.CO], 2016.
%H N.A., <a href="http://math.stackexchange.com/questions/1675498/references-to-these-functions-relating-to-binary-trees-and-binary-digit-counting">References to these functions relating to binary trees and binary digit counting?</a>, Stackexchange forum, Feb 28 2016.
%H Clark Kimberling, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Kimberling/kimber16.html"> Self-Containing Sequences, Selection Functions, and Parasequences</a>, J. Int. Seq. Vol. 25 (2022), Article 22.2.1.
%F When viewed as a table, T(h,p), related to the in order traversal of a full binary tree, T(h,p) = 2^h+(p-1)/2, p odd, 2^(h-m(p)) + (p-2^m(p)) / 2^(m(p)+1), where m(p) is the greatest value of n such that p mod 2^n == 0. m(p) = p-adic[ordp](2*p,2)-1. - _Gary Detlefs_, Sep 28 2018
%F a((2*n+1)*2^k - k - A070941(n)) = n = A025480((2*n+1)*2^k - 1); (n>=1, k>=0). - _David James Sycamore_, Apr 26 2020
%e Start with 1 and isolate it using 2,3, like this: 2,1,3. Then isolate those using 4,5,6,7, like this: 4,2,5,1,6,3,7. The next segment, to be concatenated after 4,2,5,1,6,3,7, is 8,4,9,2,10,5,11,1,12,6,13,3,14,7,15.
%p m:=p->padic[ordp](2*p,2)-1:podd:=(h,p)->2^h+(p-2)/2:peven:=(h,p)->2^(h-m(p))+(p-2^m(p))/2^(m(p)+1):for i from 0 to 5 do for j from 1 to 2^(i+1)-1 do if j mod 2 =1 then print(podd(i,j)) else print(peven(i,j)) fi od od # _Gary Detlefs_, Sep 28 2018
%t Flatten@NestList[Riffle[Range[Length[#] + 1, 2 Length[#] + 1], #] &, {1}, 4] (* _Birkas Gyorgy_, Mar 11 2011 *)
%o (PARI) A131987_row(n,r=[1])={for(k=2,n,r=vector(2^k-1,j,if(bittest(j,0),j\2+2^(k-1),r[j\2])));r}
%o apply(A131987_row,[1..6]) \\ or concat(...) \\ _M. F. Hasler_, Mar 04 2016
%Y Cf. A001511, A025480, A070941, A133108, A003602.
%K nonn,tabf
%O 1,2
%A _Clark Kimberling_, Aug 05 2007, Sep 12 2007