OFFSET
0,2
COMMENTS
Conjecture 1: a(n+5) > a(n).
Conjecture 2: There are no numbers which occur more than once.
EXAMPLE
a(4) = 14; the smallest prime not occurring earlier as difference of successive terms is 7; there are two numbers x such that abs(14 - x) = 7 and 14 + x is composite, namely x = 7 and x = 21. The larger of these numbers is 21, so a(5) = 21.
a(5) = 21; the smallest primes not occurring earlier as difference of successive terms are 11 and 17; there are two numbers x such that abs(21 - x) = 11, namely x = 10 and x = 32, but neither 21 + 10 = 31 nor 21 + 32 = 53 is composite;
there are two numbers x such that abs(21 - x) = 17, namely x = 4 and x = 38 and 21 + 38 = 59 is not composite while 21 + 4 = 25 is composite; hence a(6) = 4.
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}
{print1(a=1, ", "); v=[]; for(n=1, 51, 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(a=b, ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 27 2003
EXTENSIONS
Edited, corrected and extended by Klaus Brockhaus, Jun 28 2003
STATUS
approved