OFFSET
1,1
COMMENTS
Primes used in constructing the terms of A085401. Except for an initial part of the sequence and occasional local rearrangements later on (e.g. 199,191,193,197; 1063,1049,1051,1061) the primes appear in ascending order.
PROG
(PARI) {in(n, v)=local(j, s, b); j=1; s=matsize(v)[2]; b=1; while(b&&j<=s, if(n==v[j], b=0, j++)); !b}
{a=1; v=[]; for(n=1, 60, p=2; t=1; while(t>0, if(in(p, v), p=nextprime(p+1), if(!isprime(2*a+p), t=0; b=a+p, if(p<a&&!isprime(2*a-p), t=0; b=a-p, p=nextprime(p+1))))); v=concat(v, p); print1(p, ", "); a=b)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Jun 28 2003
STATUS
approved