OFFSET
1,2
COMMENTS
"Lexicographically earliest" means that a(n) is chosen as small as possible, in the order of increasing n, without leading to a contradiction. "Permutation" means that no integer may appear more than once, and together with the former prescription, every integer will indeed appear.
Existence of the sequence is guaranteed since terms can be filled in one after the other, and each time the place n+a(n) (which comes later) is required to be filled with a prime. This does not prevent from filling other places with primes. Since at each step the smallest available number is used, the primes as well as the composites appear in their natural order.
It appears that the primes are exactly the "early birds" of this sequence, i.e., the terms such that a(n)>n, except for {2, 3, 13, 19} which appear in their natural position. - M. F. Hasler, Oct 09 2013
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..5000
Eric Angelini, a(a(n) + n) is prime, SeqFan list, Oct 08 2013.
PROG
(PARI) {u=0; a=vector(1000); for(i=1, #a, a[i]>0 && next; for(x=1, 9e9, (!a[i] || isprime(x)) && !bittest(u, x) && (a[i]=x) && break); u+=1<<a[i]; i+a[i]<=#a && a[i+a[i]]=-1); vecextract(a, "..100")}
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Oct 08 2013
STATUS
approved