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!)
A206798 Beginning with the natural numbers, swap the k-th composite number (A002808) and k-th noncomposite number (A008578), for k = 1,2,3,... 0

%I #9 Mar 13 2015 22:56:26

%S 4,6,8,1,9,2,10,3,5,7,12,11,14,13,17,19,15,23,16,29,31,37,18,41,43,47,

%T 53,59,20,61,21,67,71,73,79,83,22,89,97,101,24,103,25,107,109,113,26,

%U 127,131,137,139,149,27,151,157,163,167,173,28,179,30,181,191

%N Beginning with the natural numbers, swap the k-th composite number (A002808) and k-th noncomposite number (A008578), for k = 1,2,3,...

%C Sequence is self-inverse permutation of natural numbers. Also swap sequence of pair of complements A002808 and A008578.

%F a(n) = A181097(n) for first 14 terms.

%e a(7) = 10 becauce number 7 is 5th term of sequence A008578 and 5th term of sequence A002808 is number 10.

%t nn = 191; t1 = Select[Range[nn], # == 1 || PrimeQ[#] &]; t2 = Complement[Range[nn], t1]; t = Range[nn]; Do[temp = t[[t1[[i]]]]; t[[t1[[i]]]] = t[[t2[[i]]]]; t[[t2[[i]]]] = temp, {i, Length[t1]}]; Take[t, Position[t, t1[[-1]]][[1, 1]]] (* _T. D. Noe_, Feb 13 2012 *)

%Y Cf. A026234 (swap the k-th prime and k-th nonprime, for k = 1,2,3,...).

%K nonn

%O 1,1

%A _Jaroslav Krizek_, Feb 12 2012

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 19 18:58 EDT 2024. Contains 371798 sequences. (Running on oeis4.)