OFFSET
1,2
EXAMPLE
a(8) has to be a multiple of 8; 16 is the smallest one that satisfies all conditions: 16 is coprime to 9, abs(a(7) - 16) = 19 is prime and distinct from all earlier absolute differences 3, 5, 7, 11, 13, 17. Hence a(8) = 16.
PROG
(PARI) {print1(a=1, ", "); v=Set([]); for(n=2, 62, k=1; b=1; while(b, m=k*n; p=abs(m-a); if(gcd(m, n+1)==1&&isprime(p)&&setsearch(v, p)==0, v=setunion(v, Set(p)); print1(m, ", "); a=m; b=0, k++)))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Jul 14 2004
STATUS
approved