login
a(1) = 1, a(2n) = composite, a(2n+1) = prime and sum of two successive terms is alternately prime or composite.
7

%I #19 Apr 27 2023 22:15:55

%S 1,4,2,9,3,8,7,6,19,10,5,12,13,16,11,18,17,14,31,22,23,20,29,24,41,26,

%T 37,30,47,32,43,28,53,36,59,38,61,40,71,42,73,34,83,44,67,46,79,48,97,

%U 52,89,50,103,54,101,56,109,58,107,60,127,64,113,66,137,62,139,72,131

%N a(1) = 1, a(2n) = composite, a(2n+1) = prime and sum of two successive terms is alternately prime or composite.

%C Conjecture: a(n+r)= A075593(n) for n > k for some k and r. What is the value of k and r?

%C This is not a permutation of the positive integers; odd composites > 9 will not appear in the sequence. - _Klaus Brockhaus_, Feb 06 2006

%H Bill McEachen, <a href="/A075594/b075594.txt">Table of n, a(n) for n = 1..10000</a>

%e 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

%o (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

%Y Cf. A075593, A103824, A103825.

%K nonn

%O 1,2

%A _Amarnath Murthy_, Sep 27 2002

%E Extended by _Ray Chandler_ Feb 16 2005