A131987 Representation of a dense para-sequence.
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, 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, 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
Offset: 1
Examples
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.
References
- C. Kimberling, Proper self-containing sequences, fractal sequences and para-sequences, preprint, 2007.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
- Josef Eschgfäller, Andrea Scarpante, Dichotomic random number generators, arXiv:1603.08500 [math.CO], 2016.
- N.A., References to these functions relating to binary trees and binary digit counting?, Stackexchange forum, Feb 28 2016.
- Clark Kimberling, Self-Containing Sequences, Selection Functions, and Parasequences, J. Int. Seq. Vol. 25 (2022), Article 22.2.1.
Programs
-
Maple
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
-
Mathematica
Flatten@NestList[Riffle[Range[Length[#] + 1, 2 Length[#] + 1], #] &, {1}, 4] (* Birkas Gyorgy, Mar 11 2011 *)
-
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} apply(A131987_row,[1..6]) \\ or concat(...) \\ M. F. Hasler, Mar 04 2016
Formula
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
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
Comments