OFFSET
1,2
COMMENTS
Conjecture: a(n+r)= A075593(n) for n > k for some k and r. What is the value of k and r?
This is not a permutation of the positive integers; odd composites > 9 will not appear in the sequence. - Klaus Brockhaus, Feb 06 2006
LINKS
Bill McEachen, Table of n, a(n) for n = 1..10000
EXAMPLE
After terms 1, 4, 2, 9, 3, we seek the next term (n = 6). The requirement is the smallest composite not already seen that summed with a(5) is prime. That number is 8 and becomes a(6). Similarly, for n = 7, we require the smallest prime not already seen that summed with a(6) is composite. As 8 + 5 is not composite, a(7) = 7. - Bill McEachen, Feb 13 2023
PROG
(PARI) genit(nterms=69)={arr=List(); listput(arr, 1); listput(arr, 4); summ=arr[#arr]+arr[#arr-1]; for(ptr=3, +oo, if(#arr>nterms, break); for(i=2, +oo, if(ptr%2!=0&&isprime(i), q=arr[ptr-1]+i; z=Set(arr); if(setsearch(z, i)>0, next); z=Set(); if(isprime(summ)&& !isprime(q), listput(arr, i); summ=arr[#arr]+arr[#arr-1]; break)); if(ptr%2==0&&!isprime(i), q=arr[ptr-1]+i; z=Set(arr); if(setsearch(z, i)>0, next); z=Set(); if(!isprime(summ)&& isprime(q), listput(arr, i); summ=arr[#arr]+arr[#arr-1]; break)))); arr} \\ Bill McEachen, Apr 09 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Sep 27 2002
EXTENSIONS
Extended by Ray Chandler Feb 16 2005
STATUS
approved