%I #18 Nov 12 2019 08:57:21
%S 3,2,19,2,3,2,19,2,3,2,29,2,3,2,61,2,3,2,19,2,3,2,19,2,3,2,61,2,3,2,
%T 61,2,3,2,19,2,3,2,19,2,3,2,29,2,3,2,151,2,3,2,19,2,3,2,19,2,3,2,149,
%U 2,3,2,151,2,3,2,19,2,3,2,19,2,3,2,47,2,3,2,61,2,3,2,19,2,3,2,19,2,3,2,61,2,3,2,61,2,3,2,19
%N Least prime such that whenever 2*a(n) is the sum of two primes, none of them is in the set F such that Sum_{p in F} 2^primepi(p-1) = n.
%C The set F=F(n) of primes corresponding to a(n) is such that its characteristic function, within the set of primes, is the binary expansion of n: F={ prime(i[1]),...,prime(i[m]) } <=> n = 2^(i[1]-1) + ... + 2^(i[m]-1). Otherwise said, the set F is the set of prime factors of A019565(n) = Product_(prime(i)^bittest(n,i-1)).
%H D. Skordev et al., <a href="http://groups.yahoo.com/group/primenumbers/message/22543">On the representation of some even numbers as sums of two prime numbers</a>, in "primenumbers" yahoo group, Feb 02 2011.
%H Dimiter Skordev and others, <a href="/A185446/a185446.txt">On the representation of some even numbers as sums of two prime numbers</a>, digest of 11 messages in primenumbers Yahoo group, Feb 2, 2011 - Feb 3, 2011.
%F a(2k) = 2; a(4k-3) = 3; a(2^k-1) = A185446(n) > prime(n).
%e For n=3, we look for the least prime P which cannot be written as sum of two primes involving prime(1)=2 or prime(2)=3 (since n=3=2^0+2^1). See A185446 for details about a(3)=19.
%e If n is even, this means the set F does not contain 2, and therefore a(n)=2 since 2*2 can only be written as 2+2, using primes not in F.
%e If n=4k-3, its binary expansion ends in ...01, i.e., the set F does contain prime(1)=2, but not prime(2)=3. Therefore a(n)=3, since 2*3 can only be written as 3+3, using primes not in F.
%o (PARI) {a(n) = forprime( p=2,default(primelimit),
%o bittest(n,primepi(p-1))&next;/*if p is in F, then 2p = p+p */
%o forprime(q=2,p-1 /* no need to test p+p */,
%o isprime(2*p-q) | next /* not sum of 2 primes */;
%o ! bittest(n,primepi(q-1)) /* q not in F */
%o & ! bittest(n,primepi(2*p-q-1)) & next; /* ok: both not in F */
%o /* one among q, 2p-q is in F: this p is not good:*/ next(2));
%o /* this p*2 had no decomposition of the form q+r with q or r in F */
%o return(p))}
%K nonn
%O 1,1
%A _M. F. Hasler_, Feb 03 2011