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 A249054 #29 Nov 04 2014 05:58:12 %S A249054 1,2,4,3,6,8,5,9,10,12,7,11,14,13,15,16,17,19,23,18,20,29,31,21,22,24, %T A249054 37,25,26,41,27,43,28,47,30,32,53,59,33,34,61,67,35,36,71,38,73,39,40, %U A249054 79,83,42,89,97,101,44,45,103,46,48,107,49,50,109,113,51 %N A249054 Defined by (i) a(1)=1; (ii) if you move a(n) steps to the right you must reach a prime; (iii) a(n) = smallest unused composite number, unless a(n) is required to be prime by (ii), in which case a(n) is the smallest unused prime. %C A249054 In contrast to A249053, here all the primes appear and in the correct order, and all the composites appear, also in increasing order. The graph shows two distinct curves. In A249053 many terms are missing, and the points lie on a single curve. %C A249054 A permutation of the positive integers with inverse A249571. %D A249054 Gabriel Cunningham, Posting to Sequence Fans Mailing List, Mar 17 2008. %H A249054 Reinhard Zumkeller, <a href="/A249054/b249054.txt">Table of n, a(n) for n = 1..10000</a> %H A249054 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A249054 a(7) = 5, so a(7+a(7)) = a(7+5) = a(12) = 11 must be prime, which it is. %o A249054 (Haskell) %o A249054 import Data.Map (singleton, findMin, delete, insert) %o A249054 a249054 n = a249054_list !! (n-1) %o A249054 a249054_list = 1 : f 1 a000040_list a002808_list (singleton 1 1) where %o A249054 f x ps'@(p:ps) cs'@(c:cs) m %o A249054 | k == x = p : f (x + 1) ps cs' (insert (x + p) 0 $ delete x m) %o A249054 | otherwise = c : f (x + 1) ps' cs (insert (x + c) 0 m) %o A249054 where (k,_) = findMin m %o A249054 -- _Reinhard Zumkeller_, Nov 01 2014 %Y A249054 See A249053 for another version. %Y A249054 Cf. A000040, A002808, A249571 (inverse). %Y A249054 Positions of primes and nonprimes: A249594 and A249595. %K A249054 nonn %O A249054 1,2 %A A249054 _N. J. A. Sloane_, Nov 01 2014 %E A249054 Data corrected by _Reinhard Zumkeller_, Nov 01 2014