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.

A257801 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = lucky(1+a(n)), a(not_an_oddprime(n)) = unlucky(a(n-1)).

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 9, 6, 11, 8, 13, 14, 25, 10, 17, 12, 15, 19, 33, 20, 35, 16, 21, 24, 18, 22, 27, 45, 43, 28, 31, 47, 23, 29, 34, 26, 51, 30, 38, 59, 63, 57, 115, 39, 42, 61, 37, 32, 40, 46, 36, 66, 73, 41, 52, 78, 83, 76, 49, 146, 67, 53, 56, 81, 50, 44, 79, 54, 60, 48, 163, 86, 87, 95, 55, 68, 101, 107, 171, 98, 64
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Comments

Here lucky(n) = n-th lucky number = A000959(n), unlucky(n) = n-th unlucky number = A050505(n), oddprime(n) = n-th odd prime = A065091(n), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).

Crossrefs

Inverse: A257802.
Related or similar permutations: A257726, A257727, A257730, A257731.

Formula

a(1) = 1; a(2) = 2; if A010051(n) = 1 [i.e., when n is an (odd) prime] then a(n) = A000959(1+a(A000720(n)-1)), otherwise a(n) = A050505(a(A062298(n))).
As a composition of other permutations:
a(n) = A257726(A257727(n)).
a(n) = A257731(A257730(n)).