cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A181096 Permutation of positive integers created from sequence A018252(n) = nonprimes.

Original entry on oeis.org

1, 4, 6, 2, 8, 3, 9, 5, 7, 10, 12, 11, 14, 13, 15, 16, 18, 17, 20, 19, 21, 22, 24, 23, 25, 26, 27, 28, 30, 29, 32, 31, 33, 34, 35, 36, 38, 37, 39, 40, 42, 41, 44, 43, 45, 46, 48, 47, 49, 50, 51, 52, 54, 53, 55, 56, 57, 58, 60, 59, 62, 61, 63, 64, 65, 66, 68, 67, 69, 70, 72, 71
Offset: 1

Views

Author

Jaroslav Krizek, Oct 02 2010

Keywords

Comments

Method of creation of sequence a(n) from b(n) = A018252(n):
Take b(1) and put in vacancy place a(1), swap this place and b(1), repeat with b(2), b(3), ...:
b(1) = 1, a(1) = 1,
b(2) = 4, a(2) = 4, a(4) = 2,
b(3) = 6, a(3) = 6, a(6) = 3,
b(4) = 8, a(5) = 8, a(8) = 5,
b(5) = 9, a(7) = 9, a(9) = 7,
...

Formula

a(n) = A135761(n) for n >= 11. a(n) = A181097(n) for n >= 11.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Jaroslav Krizek, Feb 12 2012

Keywords

Comments

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

Examples

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

Crossrefs

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

Programs

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

Formula

a(n) = A181097(n) for first 14 terms.
Showing 1-2 of 2 results.