login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A257718
a(n) = smallest prime not included earlier such that a(n) + a(n-1) + a(n-2) is a prime and is of opposite index parity to a(n-1), beginning with a(1) = 3 and a(2) = 5.
2
3, 5, 29, 67, 7, 23, 13, 11, 19, 17, 37, 47, 43, 41, 53, 73, 71, 83, 79, 31, 89, 59, 163, 109, 101, 97, 113, 103, 61, 149, 107, 127, 139, 167, 151, 191, 181, 137, 131, 211, 199, 197, 173, 277, 193, 257, 223, 179, 229, 233, 239, 367, 251, 241, 281, 307, 271, 389, 293, 157
OFFSET
1,1
COMMENTS
Is a rearrangement of A065091.
Another sequence can be created by reversing the beginning two terms. It would begin: 5, 3, 11, 29, 31, 7, 23, 13, 17, 37, ..., .
A third sequence could have a(1) = 5 and a(2) = 11 (motivated from A257717). The sequence starts: 5, 11, 3, 17, 53, 31, 13, 23, 7, 41 ... . Do any two initial odd primes generate a rearrangement of A065091? - Derek Orr, May 13 2015
EXAMPLE
a(3) = 29 since a(1)+a(2) is 8 and 29 whose index is 10 and is of opposite parity to 5, whose index being 3 is odd, is the first prime which meets the criteria. 8 + 11 = 19, a prime see A073653(3), but the prime index of 11 is 5 and is of the same parity as the prime index of 5 and therefore cannot be used.
MATHEMATICA
f[s_List] := Block[{p = s[[-2]] + s[[-1]], q = NextPrime[2, Mod[PrimePi@ s[[-1]], 2]]}, While[ !PrimeQ[p + q] || MemberQ[s, q], q = NextPrime[q, 2]]; Append[s, q]]; Nest[f, {3, 5}, 58]
PROG
(PARI) v=[3, 5]; n=1; while(n<100, p=prime(n); if((primepi(v[#v])-n)%2&&isprime(v[#v]+v[#v-1]+p)&&!vecsearch(vecsort(v), p), v=concat(v, p); n=0); n++); v \\ Derek Orr, May 13 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, May 05 2015
STATUS
approved