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

 


Aronson transform of the "evil" sequence (A001969).
9

%I #9 Jul 09 2017 20:40:24

%S 2,3,5,7,9,11,12,13,15,16,17,18,20,21,23,24,27,29,31,33,34,35,36,39,

%T 41,42,43,44,45,47,48,49,51,53,54,57,59,61,63,64,65,66,68,71,72,73,75,

%U 77,78,79,80,81,83,85,87,88,89,91,92,93,95,97,99,101,102,105,107,108,109

%N Aronson transform of the "evil" sequence (A001969).

%C b(n) positive monotonic sequence is the Aronson transform of a(n) positive monotonic sequence if every member of a(n) satisfies the condition: "k is in b if and only if b(k) is in a", so that k must be the least such number.

%H F. Adorjan, <a href="http://web.axelero.hu/fadorjan/aronsf.pdf">Binary mapping of monotonic sequences and the Aronson function</a>

%H B. Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="http://www.emis.de/journals/JIS/VOL6/Cloitre/cloitre2.html">Numerical analogues of Aronson's sequence</a>, J. Integer Seqs., Vol. 6 (2003), #03.2.2.

%H B. Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="http://arXiv.org/abs/math.NT/0305308">Numerical analogues of Aronson's sequence</a>, arXiv:math/0305308 [math.NT], 2003.

%o (PARI) {arons(v)= /* Returns the Aronson transform of v */ local(x=[],pv=1,px=1,n=1,i=0,k,l); l=matsize(v)[2];

%o /*The initial terms: */ if(n<v[pv],n+=1;while(n==v[pv],n+=1;pv+=1);x=concat (x,n);n+=1;i+=1, while((n<l)&&(v[pv]==n),x=concat (x,n);n+=1;pv+=1;i+=1));

%o /*The induction:*/ while(abs(pv)<=l&&n<v[l],k=x[i];n=k;pv=isin(i+1,v,l,pv);

%o /* pv>0 if (i+1) is in v */ if(k==i,n+=1;if(pv<0,pv=abs(pv);while(pv>0,n+=1;pv=isin (n,v,l,pv))), px=isin(i+1,x,i,px);if(px>0,pv=-abs(pv);while (pv<0,n+=1;pv=isin(n,v,l,pv)), pv=abs(pv);while(pv>0,n+=1;pv=isin(n,v,l,pv)))); x=concat(x,n);i+=1);/*print(i);*/ return(x) }

%o {isin(x,v,l,poi)= /*If x integer is in v monotonic vector of length l, the function returns a positive 'poi', else a negative one. (poi is pointer, used for acceleration. The last returned value is recommended in the input) */

%o poi=abs(poi);if(poi==1&&x<v[1], return(-poi), if(x<v[poi], while(x<v[poi]&&poi>1,poi-=1);if(x<>v [poi],poi*=-1), if(x>v[poi], while(x>v[poi]&&poi<l,poi+=1);if(x<>v [poi],poi*=-1)));return(poi))}

%Y Cf. A079254, A079257, A079258, A080760.

%K easy,nonn

%O 1,1

%A Ferenc Adorjan (fadorjan(AT)freemail.hu)

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 21 03:31 EDT 2024. Contains 376079 sequences. (Running on oeis4.)