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.

A257732 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = prime(a(n-1)), a(unlucky(n)) = composite(a(n)), where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505, and prime = A000040, composite = A002808.

Original entry on oeis.org

1, 4, 2, 9, 6, 16, 7, 12, 3, 26, 14, 21, 23, 8, 13, 39, 24, 33, 35, 15, 53, 22, 56, 36, 17, 49, 51, 25, 75, 34, 37, 78, 5, 52, 27, 69, 101, 72, 38, 102, 50, 54, 43, 106, 10, 74, 40, 94, 73, 134, 83, 98, 55, 135, 70, 76, 62, 141, 18, 100, 57, 125, 19, 99, 175, 114, 41, 130, 167, 77, 176, 95, 89, 104, 137, 86, 184, 28, 149, 133, 80, 164, 30
Offset: 1

Views

Author

Antti Karttunen, May 06 2015

Keywords

Comments

In other words, a(1) = 1 and for n > 1, if n is the k-th lucky number larger than 1 [i.e., n = A000959(k+1)] then a(n) = nthprime(a(k)), otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], then a(n) = nthcomposite(a(k)).

Crossrefs

Inverse: A257731.
Related or similar permutations: A246378, A255422, A257725, A257734.
Cf. also A032600, A255553, A255554.

Formula

a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = A000040(a(A109497(n)-1)), otherwise a(n) = A002808(a(n-A109497(n))).
As a composition of other permutations:
a(n) = A246378(A257725(n)).
a(n) = A255422(A257734(n)).