

A255422


Permutation of natural numbers: a(1) = 1 and for n > 1, if n is kth ludic number larger than 1 [i.e., n = A003309(k+1)], a(n) = nthprime(a(k)), otherwise, when n is kth nonludic number [i.e., n = A192607(k)], a(n) = nthcomposite(a(k)), where nthcomposite = A002808, nthprime = A000040.


7



1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 24, 19, 25, 23, 26, 27, 28, 29, 32, 33, 34, 36, 30, 38, 35, 31, 39, 40, 42, 37, 44, 41, 48, 49, 50, 43, 52, 45, 55, 51, 46, 47, 56, 57, 60, 54, 63, 58, 68, 53, 69, 70, 62, 74, 64, 59, 77, 72, 65, 61, 66, 78, 80, 84, 76, 71, 87, 81
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

The graph has a comet appearance.  Daniel Forgues, Dec 15 2015


LINKS

Antti Karttunen, Table of n, a(n) for n = 1..8192
Antti Karttunen, Entanglement Permutations, 20162017
Index entries for sequences that are permutations of the natural numbers


FORMULA

a(1)=1; and for n > 1, if A192490(n) = 1 [i.e., n is ludic], a(n) = A000040(a(A192512(n)1)), otherwise a(n) = A002808(a(A236863(n))) [where A192512 and A236863 give the number of ludic and nonludic numbers <= n, respectively].
As a composition of other permutations: a(n) = A246378(A237427(n)).


EXAMPLE

When n = 19 = A192607(11) [the eleventh nonludic number], we look for the value of a(11), which is 11 [all terms less than 19 are fixed because the beginnings of A003309 and A008578 coincide up to A003309(8) = A008578(8) = 17], and then take the eleventh composite number, which is A002808(11) = 20, thus a(19) = 20.
When n = 25 = A003309(10) = A003309(1+9) [the tenth ludic number, and ninth after one], we look for the value of a(9), which is 9 [all terms less than 19 are fixed, see above], and then take the ninth prime number, which is A000040(9) = 23, thus a(25) = 23.


PROG

(Scheme, with memoizationmacro definec)
(definec (A255422 n) (cond ((= 1 n) n) ((= 1 (A192490 n)) (A000040 (A255422 ( (A192512 n) 1)))) (else (A002808 (A255422 (A236863 n))))))
;; Alternatively:
(define (A255422 n) (A246378 (A237427 n)))


CROSSREFS

Inverse: A255421.
Cf. A000040, A002808, A003309, A192490, A192512, A192607, A236863.
Related or similar permutations: A237427, A246378, A245703, A245704 (compare the scatterplots), A255407, A255408.
Sequence in context: A276347 A076121 A239427 * A080681 A272322 A246079
Adjacent sequences: A255419 A255420 A255421 * A255423 A255424 A255425


KEYWORD

nonn,look


AUTHOR

Antti Karttunen, Feb 23 2015


STATUS

approved



