OFFSET
1,2
COMMENTS
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.
A permutation of the positive integers with inverse A249571.
REFERENCES
Gabriel Cunningham, Posting to Sequence Fans Mailing List, Mar 17 2008.
LINKS
EXAMPLE
a(7) = 5, so a(7+a(7)) = a(7+5) = a(12) = 11 must be prime, which it is.
PROG
(Haskell)
import Data.Map (singleton, findMin, delete, insert)
a249054 n = a249054_list !! (n-1)
a249054_list = 1 : f 1 a000040_list a002808_list (singleton 1 1) where
f x ps'@(p:ps) cs'@(c:cs) m
| k == x = p : f (x + 1) ps cs' (insert (x + p) 0 $ delete x m)
| otherwise = c : f (x + 1) ps' cs (insert (x + c) 0 m)
where (k, _) = findMin m
-- Reinhard Zumkeller, Nov 01 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 01 2014
EXTENSIONS
Data corrected by Reinhard Zumkeller, Nov 01 2014
STATUS
approved