login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257801 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = lucky(1+a(n)), a(not_an_oddprime(n)) = unlucky(a(n-1)). 5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

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

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..10000

Index entries for sequences that are permutations of the natural numbers

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

PROG

(Scheme, with memoizing definec-macro)

(definec (A257801 n) (cond ((<= n 2) n) ((= 1 (A010051 n)) (A000959 (+ 1 (A257801 (+ -1 (A000720 n)))))) (else (A050505 (A257801 (A062298 n))))))

;; Alternatively, by composing other permutations:

(define (A257801 n) (A257726 (A257727 n)))

CROSSREFS

Inverse: A257802.

Cf. A000959, A000720, A010051, A050505, A062298, A065090, A065091.

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

Sequence in context: A308301 A125150 A265901 * A257726 A183089 A191544

Adjacent sequences:  A257798 A257799 A257800 * A257802 A257803 A257804

KEYWORD

nonn

AUTHOR

Antti Karttunen, May 09 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 22 03:20 EST 2019. Contains 329383 sequences. (Running on oeis4.)