

A206798


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


0



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, 53, 59, 20, 61, 21, 67, 71, 73, 79, 83, 22, 89, 97, 101, 24, 103, 25, 107, 109, 113, 26, 127, 131, 137, 139, 149, 27, 151, 157, 163, 167, 173, 28, 179, 30, 181, 191
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Sequence is selfinverse permutation of natural numbers. Also swap sequence of pair of complements A002808 and A008578.


LINKS

Table of n, a(n) for n=1..63.


FORMULA

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


EXAMPLE

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


MATHEMATICA

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 *)


CROSSREFS

Cf. A026234 (swap the kth prime and kth nonprime, for k = 1,2,3,...).
Sequence in context: A326426 A272028 A181097 * A200366 A217296 A330154
Adjacent sequences: A206795 A206796 A206797 * A206799 A206800 A206801


KEYWORD

nonn


AUTHOR

Jaroslav Krizek, Feb 12 2012


STATUS

approved



