login
A096879
a(1) = 1; for n > 1: a(n) = least multiple m of n such that m is coprime to n+1 and the absolute difference of a(n) and a(n-1) is a prime distinct from all earlier such differences of consecutive terms.
2
1, 4, 9, 16, 5, 18, 35, 16, 63, 10, 77, 36, 13, 56, 135, 32, 289, 18, 209, 100, 63, 176, 115, 144, 175, 26, 405, 56, 319, 90, 31, 128, 495, 34, 245, 72, 481, 38, 351, 40, 779, 126, 43, 704, 45, 184, 47, 240, 637, 50, 357, 520, 53, 486, 55, 392, 285, 58, 767, 120, 793, 992
OFFSET
1,2
COMMENTS
Suggested by A096134.
Primes arising as absolute first differences are given in A096880.
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
Sequence in context: A070643 A070442 A086957 * A070441 A070440 A368103
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Jul 14 2004
STATUS
approved