OFFSET
1,2
LINKS
Eric Angelini, Yellow commas, pink, red, blue..., personal blog "Cinquante signes" on blogspot.com, May 17 2020
EXAMPLE
The prime terms are at indices 2, 3, 5, 8, 12, 17, 23, 31, 38, 47, 57, 69, 80, 94, ...; first differences give 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 12, 11, 14, ... = the sequence itself.
PROG
(PARI) upto(N)={local(U=[2]); my(a=Vec([1, 2], N), i=1, L=2, nxt(p)=while(#U>1 && U[2]==U[1]+1, U=U[^1]); my(t=U[1]); until(if(p, t=nextprime(t+1), !isprime(t+=1)) && !setsearch(U, t), ); U=setunion(U, [t]); t); for(n=3, N, a[n]=nxt(n-L==a[i] && i++ && L=n)); a}
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, May 19 2020
STATUS
approved