The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A159193 a(n) is the smallest positive integer not yet in the sequence with gcd(n,a(n)) > 1 but a(n) != n; a(1) = 1 by convention. 1

%I

%S 1,4,6,2,10,3,14,12,15,5,22,8,26,7,9,18,34,16,38,24,27,11,46,20,30,13,

%T 21,32,58,25,62,28,36,17,40,33,74,19,42,35,82,39,86,48,50,23,94,44,56,

%U 45,54,60,106,51,65,49,63,29,118,52,122,31,57,66,55,64,134,70,72,68,142

%N a(n) is the smallest positive integer not yet in the sequence with gcd(n,a(n)) > 1 but a(n) != n; a(1) = 1 by convention.

%C This is a permutation of the positive integers with a(a(n)) = n.

%C Does every positive rational occur as a value of a(n)/n?

%H Ivan Neretin, <a href="/A159193/b159193.txt">Table of n, a(n) for n = 1..10000</a>

%t a = {1}; Do[AppendTo[a, Complement[Select[Range[Max[a] + 2 n], GCD[#, n] > 1 &], a, {n}][[1]]], {n, 2, 71}]; a (* _Ivan Neretin_, Jul 09 2015 *)

%o (PARI) va(n) = local(v); v=vector(n);v[1]=1;for(k=2,n,v[k]=na(v,k));v

%o na(v, k) = for(i=1,2*k,if(gcd(i,k)>1&&i!=k,if(!inv(v,k-1,i),return(i))))

%o inv(v, k, x) = for(i=1,k,if(v[i]==x,return(1)));return(0)

%K nonn

%O 1,2

%A _Franklin T. Adams-Watters_, Apr 05 2009

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

Last modified December 3 00:59 EST 2021. Contains 349445 sequences. (Running on oeis4.)