%I #14 May 07 2015 19:49:45
%S 1,3,9,2,33,5,7,14,4,45,163,8,15,11,20,6,25,59,203,12,22,17,63,28,13,
%T 10,35,78,235,251,18,30,24,83,39,19,1093,16,47,101,31,290,67,309,26,
%U 41,43,34,107,53,27,1283,87,23,61,128,42,354,88,376,21,36,55,57,46,137,115,70,38,1499,321,112,32,81,161,56,1401,430,113,454,29,48,49
%N Permutation of natural numbers: a(1) = 1, a(ludic(n)) = lucky(1+a(n-1)), a(nonludic(n)) = unlucky(a(n)), where ludic(n) = n-th ludic number A003309, nonludic(n) = n-th nonludic number A192607 and lucky = A000959, unlucky = A050505.
%H Antti Karttunen, <a href="/A257733/b257733.txt">Table of n, a(n) for n = 1..8587</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(1) = 1; for n > 1: if A192490(n) = 1 [i.e., if n is ludic], then a(n) = A000959(1+a(A192512(n)-1)), otherwise a(n) = A050505(a(A236863(n))).
%F As a composition of other permutations:
%F a(n) = A257731(A255422(n)).
%F a(n) = A257726(A237427(n)).
%o (Scheme, with memoization-macro definec)
%o (definec (A257733 n) (cond ((= 1 n) n) ((= 1 (A192490 n)) (A000959 (+ 1 (A257733 (+ -1 (A192512 n)))))) (else (A050505 (A257733 (A236863 n))))))
%o ;; Alternatively, by composing other permutations:
%o (define (A257733 n) (A257731 (A255422 n)))
%o (define (A257733 n) (A257726 (A237427 n)))
%Y Inverse: A257734.
%Y Cf. A000959, A050505, A003309, A192607, A192490, A192512, A236863.
%Y Related or similar permutations: A237427, A255422, A257726, A257731.
%Y Cf. also A256486, A256487.
%Y Differs from A257731 for the first time at n=19, where a(19) = 203, while A257731(19) = 63.
%K nonn,look
%O 1,2
%A _Antti Karttunen_, May 06 2015