cp's OEIS Frontend

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.

A131987 Representation of a dense para-sequence.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Aug 05 2007, Sep 12 2007

Keywords

Comments

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).
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.
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
Subsequence of A025480 (omitting all terms=0). - David James Sycamore, Apr 26 2020
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

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.

Crossrefs

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