login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A026142 Lexicographically earliest permutation of the positive integers such that for n >= 2, |a(n)-n| = [(a(n)+1)/2]. 13
1, 4, 2, 8, 3, 12, 14, 5, 6, 20, 7, 24, 26, 9, 10, 32, 11, 36, 38, 13, 42, 44, 15, 16, 50, 17, 18, 56, 19, 60, 62, 21, 22, 68, 23, 72, 74, 25, 78, 80, 27, 28, 86, 29, 30, 92, 31, 96, 98, 33, 34, 104, 35, 108, 110, 37, 114, 116, 39, 40, 122, 41, 126, 128, 43, 132 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Old name: For n >= 2, let h=[ (n+1)/2 ], L=n-h, R=n+h; a(L)=n if a(L) not yet defined, else a(R)=n; thus |a(n)-n| = [ (a(n)+1)/2 ].
From Peter Munn, Jan 07 2022: (Start)
A value m occurs at an index n, n < m if and only if m has the form 3^i*4 or 3^i*(6k+2), k >= 1.
Proof:
For k >= 1, values of the form 2k+1 occur at index 2k+1 + [(2k+1+1)/2] = 3k+2 and not at index 2k+1 - [(2k+1+1)/2] = k, because a(k) can take the value 2k and 2k cannot occur earlier.
So, for k >= 1, values of the form 6k+4 occur at index 6k+4 + [(6k+4+1)/2] = 9k+6, and not at index 6k+4 - [(6k+4+1)/2] = 3k+2 because a(3k+2) takes the value 2k+1.
For k >= 1, values of the form 6k+2 occur at index 6k+2 - [(6k+2+1)/2] = 3k+1, because numbers of the form 3k+1 do not have the form m+[(m+1)/2] for any m > 0. (Note that for k = 0, 1 occurs at index 1 due to an explicit exemption from the definition's constraining rule.)
A value of the form 6k occurs at index 6k - [(6k+1)/2] = 3k if and only if 2k occurs at index k rather than occupying index 3k.
From the characterization above of cases 6k+4, 6k+2 and 6k we see the following: an even number 2j > 4 occurs before or after position 2j depending on the base 3 representation of j with its trailing zeros removed. (With respect to the statement being proved j = 3^i*2 or 3^i*(3k+1).)
(End)
LINKS
F. M. Dekking, Permutations of N generated by left-right filling algorithms, arXiv:2001.08915 [math.CO], 2020.
MATHEMATICA
Block[{a, nn = 132}, a[1] = 1; Do[If[! IntegerQ[a[#1]], Set[a[#1], i], Set[a[#2], i]] & @@ {i - #, i + #} &@ Floor[(i + 1)/2], {i, nn}]; TakeWhile[Array[a[#] &, nn], IntegerQ]] (* Michael De Vlieger, Apr 17 2020 *)
CROSSREFS
Sequence in context: A133640 A065171 A026192 * A095399 A250718 A068504
KEYWORD
nonn
AUTHOR
EXTENSIONS
New name from Peter Munn, Jan 07 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 09:43 EDT 2024. Contains 371994 sequences. (Running on oeis4.)