# Permutations based on themselves

zak seidov zakseidov at yahoo.com
Mon Apr 24 04:37:14 CEST 2006

```--- Leroy Quet <qq-quet at mindspring.com> wrote:

<skip>
> >%S A118315 1,2,3,4,6,5,9,7,12,8,16,10,17,11
> >%N A118315 a(1)=1. a(2n)= lowest positive integer
> not occurring among the
> >earlier terms of the sequence. a(2n+1) = the a(n)th
> positive integer among
> >those positive integers not occurring earlier in
> the sequence.
<skip>
> Is there a direct way to calculate the nth term..
<skip>

No explicit formula yet, but
here's dirty Mmca with first 200 terms of the SEQ:
s={1};a=Range[1000];b=Rest[a];Do[
c=If[OddQ[n],b[[s[[(n-1)/2]]]],b[[1]]];b=Complement[b,{c}];AppendTo[s,c],{n,2,200}];s
{1,2,3,4,6,5,9,7,12,8,16,10,17,11,23,13,22,14,30,15,27,18,38,19,33,20,43,21,37,24,53,25,44,26,56,28,48,29,68,31,52,32,69,34,60,35,84,36,64,39,82,40,70,41,97,42,74,45,94,46,80,47,115,49,86,50,109,51,90,54,126,55,96,57,121,58,101,59,146,61,106,62,133,63,111,65,155,66,117,67,149,71,122,72,178,73,127,75,161,76,134,77,184,78,138,79,174,81,142,83,207,85,147,87,187,88,154,89,212,91,159,92,200,93,164,95,241,98,169,99,215,100,173,102,243,103,179,104,226,105,186,107,268,108,191,110,239,112,196,113,271,114,201,116,253,118,205,119,304,120,211,123,265,124,217,125,298,128,221,129,279,130,227,131,329,132,231,135,292,136,235,137,331,139,245,140,306,141,249,143,368,144,254,145,318,148,259,150,358,151}

The first absent number is 152. And
"the first absent number as function of n"
is also of interest. Zak

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

```