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 A257802 #13 May 10 2015 11:00:40 %S A257802 1,2,3,4,6,8,5,10,7,14,9,16,11,12,17,22,15,25,18,20,23,26,33,24,13,36, %T A257802 27,30,34,38,31,48,19,35,21,51,47,39,44,49,54,45,29,66,28,50,32,70,59, %U A257802 65,37,55,62,68,75,63,42,90,40,69,46,94,41,81,88,52,61,76,83,85,92,100,53,86,101,58,120,56,67,93,64 %N A257802 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = oddprime(a(n-1)), a(unlucky(n)) = not_an_oddprime(1+a(n)). %C A257802 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). %H A257802 Antti Karttunen, <a href="/A257802/b257802.txt">Table of n, a(n) for n = 1..10000</a> %H A257802 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A257802 a(1) = 1; if A145649(n) = 1 [i.e., when n is lucky] then a(n) = A065091(a(A109497(n)-1)), otherwise a(n) = A065090(1+a(n-A109497(n))). %F A257802 As a composition of other permutations: %F A257802 a(n) = A257728(A257725(n)). %F A257802 a(n) = A257729(A257732(n)). %o A257802 (Scheme, with memoizing definec-macro) %o A257802 (definec (A257802 n) (cond ((= 1 n) n) ((= 1 (A145649 n)) (A065091 (A257802 (- (A109497 n) 1)))) (else (A065090 (+ 1 (A257802 (- n (A109497 n)))))))) %o A257802 ;; Alternatively, by composing other permutations: %o A257802 (define (A257802 n) (A257728 (A257725 n))) %Y A257802 Inverse: A257801. %Y A257802 Cf. A000959, A050505, A065090, A065091, A109497, A145649. %Y A257802 Related or similar permutations: A257725, A257728, A257729, A257732. %K A257802 nonn %O A257802 1,2 %A A257802 _Antti Karttunen_, May 09 2015