# A Permutation Defining Itself

Leroy Quet qq-quet at mindspring.com
Sat Dec 18 18:28:40 CET 2004

Yet another permutation of the positive integers defined by the sequence
itself:

>%S A000001 1,2,4,3,7,9,6,5,13,15,19,17,11,14,10,8
>%N A000001 a(1)= 1; a(n) = a(2^ceiling(log_2(n))+1-n)th lowest positive
>integer not yet in the sequence.
>%C A000001 Sequence is a permutation of the positive integers.
>2^ceiling(log_2(n)) +1 -n is sequence A080079 with a change of offset.
>%e A000001 Since 2^ceiling(log_2(n)) +1 -n = 3 at n = 6, a(6) = the a(3)th
>(the 4th) lowest positive integer not among the first 5 terms of the
>sequence.
>The positive integers not among the first 5 terms are 5,6,8,9,10,...
>The 4th of these is 9, which is a(6).
>%O A000001 1
>%K A000001 ,easy,more,nonn,
>%A A000001 Leroy Quet (qq-quet at mindspring.com), Dec 18 2004

I wonder, as I do about the sequence in the quote below, is there a
direct way to calculate the terms of the sequence above?

thanks,
Leroy Quet

>I just submitted this sequence (which I find interesting) to the EIS:
>
>>%S A000001 1,2,1,4,1,3,1,8,1,5,1,9,1,6,1,16,1,7,1,14,1,10,1,21,1,11,1
>>%N A000001 a(2n-1) = 1;
>>a(2n) = a(n)th lowest positive integer not among the earlier terms of the
>>sequence.
>>%C A000001 The sequence {a(2k)} forms a permutation of the integers >= 2.
>>%e A000001 a(12) = the a(6)th (the 3rd) lowest positive integer not among
>>the first 11 terms of the sequence. Not among the first 11 terms are 6, 7,
>>9, 10,...
>>The 3rd of these is 9, which is a(12).
>>%O A000001 1
>>%K A000001 ,easy,more,nonn,
>>%A A000001 Leroy Quet (qq-quet at mindspring.com), Dec 17 2004

>Is there a direct (nonrecursive) way to calculate the terms of the
>sequence?
>
>
>By the way, the "Quet transform (involving permutations)" of the sequence
>yields
>(if I calculated right)
>1,2,1,2,3,4,1,1,3,4,...
>
>Does this second sequence have any significance, can its terms be
>directly calculated?
>
>thanks,
>Leroy Quet