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

%I #26 Dec 10 2019 12:09:55

%S 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,

%T 27,28,29,32,33,34,36,30,38,35,31,39,40,42,37,44,41,48,49,50,43,52,45,

%U 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

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

%C The graph has a comet appearance. - _Daniel Forgues_, Dec 15 2015

%H Antti Karttunen, <a href="/A255422/b255422.txt">Table of n, a(n) for n = 1..8192</a>

%H Antti Karttunen, <a href="/A135141/a135141.pdf">Entanglement Permutations</a>, 2016-2017

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F 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].

%F As a composition of other permutations: a(n) = A246378(A237427(n)).

%e 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.

%e 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.

%o (Scheme, with memoization-macro definec)

%o (definec (A255422 n) (cond ((= 1 n) n) ((= 1 (A192490 n)) (A000040 (A255422 (- (A192512 n) 1)))) (else (A002808 (A255422 (A236863 n))))))

%o ;; Alternatively:

%o (define (A255422 n) (A246378 (A237427 n)))

%Y Inverse: A255421.

%Y Cf. A000040, A002808, A003309, A192490, A192512, A192607, A236863.

%Y Related or similar permutations: A237427, A246378, A245703, A245704 (compare the scatterplots), A255407, A255408.

%K nonn,look

%O 1,2

%A _Antti Karttunen_, Feb 23 2015