OFFSET
0,2
COMMENTS
First differences are primes and negative nonprimes; their absolute values yield a permutation of the positive integers.
See A282864 for the permutation of the nonnegative integers corresponding to the order in which the numbers are used in this sequence.
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..10000 (a(0..5000) from Jean-Marc Falcoz.)
E. Angelini, Le restaurant new-yorkais, February 2017
PROG
(PARI) A282846(n, s=0, a=0, c=1, p=2)={for(n=1, n, s&&print1(a", "); if(a<c, a+=p; p=nextprime(p+1), a-=c; while(isprime(c++), ))); a} \\ Set 2nd argument s to 1 to print all intermediate terms.
CROSSREFS
KEYWORD
nonn,look
AUTHOR
STATUS
approved