OFFSET
1,2
COMMENTS
a(n+a(n)+1) is the term reached by "jumping over" a(n) terms to the right of a(n).
LINKS
E. Angelini, Small perturbations in the natural flow, SeqFan list, Apr 12 2012
EXAMPLE
a(1)=1 means that jumping over its neighbor a(2) we will land on a(3) which must not be prime, since a(1) is not. Therefore a(3) cannot equal 3, the least possibility is a(3)=4.
a(2)=2 means that jumping over a(3), a(4), we will land on a(5) which must be prime, as is a(2).
a(4) is not restricted and the smallest unused number is 3, but we cannot have a(4)=3 since then, jumping over 3 terms we get to a(4+3+1)=a(8) which would also have to be prime, but a(3)=4 already imposed that a(3+4+1) is composite as a(3). Therefore the smallest possibility is a(4)=5, and the (prime) number 3 will be used for a(5).
PROG
(PARI) {S=vector(222); u=0; for(n=1, 100, a=0; while( bittest(u, a++) || (S[n] & 2^isprime(a)+S[n]) || (S[n+a+1] & 2^isprime(a)+S[n+a+1]), ); u+=1<<S[n]=a; S[n+a+1]=-2^isprime(a)); vecextract(S, "1..100")} \\ - M. F. Hasler, Apr 12 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini, Apr 12 2012
STATUS
approved