

A249053


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 greater than a(n1), unless a(n) is required to be prime by (ii), in which case a(n) is the smallest unused prime greater than a(n1).


2



1, 2, 4, 5, 6, 8, 11, 12, 13, 14, 17, 18, 20, 23, 24, 25, 26, 29, 30, 31, 32, 37, 38, 41, 42, 44, 45, 47, 48, 53, 54, 55, 59, 60, 62, 63, 67, 68, 71, 72, 73, 74, 79, 80, 81, 82, 83, 84, 89, 90, 97, 98, 101, 102, 104, 105, 106, 108, 109, 110, 113, 114, 115
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


REFERENCES

Eric Angelini, Posting to Sequence Fans Mailing List, Mar 17 2008 (the definition was clarified by Gabriel Cunningham).


LINKS



PROG

(Haskell)
import Data.Map (singleton, findMin, delete, insert)
a249053 n = a249053_list !! (n1)
a249053_list = 1 : f 1 1 a002808_list (singleton 1 1) where
f x z cs m
 k == x = p : f (x + 1) p cs (insert (x + p) 0 $ delete x m)
 otherwise = c : f (x + 1) c cs' (insert (x + c) 0 m)
where p = a007918 z
(c:cs') = dropWhile (<= z) cs
(k, _) = findMin m


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



