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.
%I A257732 #16 May 07 2015 19:50:50 %S A257732 1,4,2,9,6,16,7,12,3,26,14,21,23,8,13,39,24,33,35,15,53,22,56,36,17, %T A257732 49,51,25,75,34,37,78,5,52,27,69,101,72,38,102,50,54,43,106,10,74,40, %U A257732 94,73,134,83,98,55,135,70,76,62,141,18,100,57,125,19,99,175,114,41,130,167,77,176,95,89,104,137,86,184,28,149,133,80,164,30 %N A257732 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = prime(a(n-1)), a(unlucky(n)) = composite(a(n)), where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505, and prime = A000040, composite = A002808. %C A257732 In other words, a(1) = 1 and for n > 1, if n is the k-th lucky number larger than 1 [i.e., n = A000959(k+1)] then a(n) = nthprime(a(k)), otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], then a(n) = nthcomposite(a(k)). %H A257732 Antti Karttunen, <a href="/A257732/b257732.txt">Table of n, a(n) for n = 1..10000</a> %H A257732 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A257732 a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = A000040(a(A109497(n)-1)), otherwise a(n) = A002808(a(n-A109497(n))). %F A257732 As a composition of other permutations: %F A257732 a(n) = A246378(A257725(n)). %F A257732 a(n) = A255422(A257734(n)). %o A257732 (Scheme, with memoization-macro definec) %o A257732 (definec (A257732 n) (cond ((= 1 n) n) ((= 1 (A145649 n)) (A000040 (A257732 (- (A109497 n) 1)))) (else (A002808 (A257732 (- n (A109497 n))))))) %o A257732 ;; Alternatively, by composing other permutations: %o A257732 (define (A257732 n) (A246378 (A257725 n))) %o A257732 (define (A257732 n) (A255422 (A257734 n))) %Y A257732 Inverse: A257731. %Y A257732 Cf. A000040, A000959, A002808, A050505, A109497, A145649. %Y A257732 Related or similar permutations: A246378, A255422, A257725, A257734. %Y A257732 Cf. also A032600, A255553, A255554. %K A257732 nonn,look %O A257732 1,2 %A A257732 _Antti Karttunen_, May 06 2015