

A085061


a(0) = 1; a(n+1) is the largest positive number (of at most two) such that abs(a(n)  a(n+1)) is the smallest prime not occurring earlier as difference of successive terms and a(n) + a(n+1) is composite.


2



1, 3, 6, 19, 14, 21, 4, 23, 34, 57, 86, 117, 158, 121, 164, 211, 264, 205, 266, 199, 270, 353, 426, 505, 594, 691, 590, 487, 594, 485, 598, 725, 856, 993, 1132, 1281, 1124, 973, 1136, 1303, 1476, 1655, 1474, 1665, 1858, 2055, 2254, 2465, 2242, 2469, 2240, 2473
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

Conjecture 1: a(n+5) > a(n).
Conjecture 2: There are no numbers which occur more than once.


LINKS

Table of n, a(n) for n=0..51.


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*ap), t=0; b=ap, p=nextprime(p+1))))); v=concat(v, p); print1(a=b, ", "))}


CROSSREFS

Cf. A085400, A085401.
Sequence in context: A307334 A057268 A085401 * A294570 A306968 A090956
Adjacent sequences: A085058 A085059 A085060 * A085062 A085063 A085064


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



