Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #39 Oct 21 2016 12:34:33
%S 2,7,19,31,37,79,97,157,199,211,229,271,307,331,367,379,439,499,577,
%T 601,607,661,727,829,877,967,997,1009,1069,1171,1279,1459,1531,1609,
%U 1627,1657,1759,1867,2011,2029,2131,2137,2311,2551,2557,3037,3061,3109,3169,3181
%N Primes p such that the p-th odious number is prime; odious primes p such that 2p-1 is prime.
%C From _Antti Karttunen_, Nov 29 & 30 2013: (Start)
%C This sequence is the intersection of A005382 and A027697.
%C Proof:
%C A000069(n) reduces according to the bit parity of n-1 as follows:
%C A000069(n) = 2n - 2 when n-1 is odious.
%C A000069(n) = 2n - 1 when n-1 is evil.
%C which means that no prime in this sequence can be evil, as then p-1 would be an odious number (true for all odd primes) and A000069(p) would be 2(p-1) which obviously cannot be a prime, contradicting the requirement. Thus all primes present must belong to the set of odious primes, A027697.
%C As each prime p here is thus odious, it means that each p-1 is an evil number (A001969), and thus A000069(p) = 2p-1. And the stipulation that it also must be prime, is just what is required from the terms of A005382. Thus this sequence contains exactly those primes that occur in both A005382 and A027697.
%C Equally: this is the intersection of A000069 and A005382, thus prime p occurs here iff A000120(p) is odd and 2p-1 is prime also.
%C Also, apart from the first term (2), all the primes (2*a(n))-1 are also odious. This follows because for any odd number k, A000120(2k-1) = A000120(k).
%C (End)
%H Antti Karttunen, <a href="/A232667/b232667.txt">Table of n, a(n) for n = 1..225</a>
%e 7 is a prime and A000069(7) = 13, a prime also, thus 7 is in this sequence.
%e 19 is a prime and A000069(19) = 37, a prime also, thus 19 is in this sequence.
%e Alternatively:
%e 7 is a prime, 2*7-1 = 13 is also prime, and when written in binary, 7 = '111', with an odd number of 1-bits. Thus 7 is included in this sequence.
%e The next time this happens, is for 19, as it is a prime, 2*19-1 = 37 is also prime, and when written in binary, 19 = '10011', also has on odd number of 1-bits.
%o (Scheme, with _Antti Karttunen_'s IntSeq-library and Aubrey Jaffer's SLIB-library)
%o (require 'factor) ;; Includes predicate prime? from SLIB-library.
%o ;; Implementation based on the original definition:
%o (define A232667 (COMPOSE A000040 (MATCHING-POS 1 1 (lambda (k) (prime? (A000069 (A000040 k)))))))
%o ;; Alternative implementation based on the other definition:
%o (define A232667 (MATCHING-POS 1 1 (lambda (n) (and (odd? (A000120 n)) (prime? n) (prime? (- (* 2 n) 1))))))
%Y Cf. A000040, A000069, A001969, A000120, A005382, A027697, A092246, A232637.
%K nonn
%O 1,1
%A _Juri-Stepan Gerasimov_, Nov 27 2013
%E Edited and erroneous terms removed by _Antti Karttunen_, Nov 29-30 2013