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”).

A095282
Primes whose binary-expansion ends with an even number of 1's.
4
2, 3, 11, 19, 43, 47, 59, 67, 79, 83, 107, 131, 139, 163, 179, 191, 211, 227, 239, 251, 271, 283, 307, 331, 347, 367, 379, 419, 431, 443, 463, 467, 491, 499, 523, 547, 563, 571, 587, 619, 643, 659, 683, 691, 719, 739, 751, 787, 811, 827, 859
OFFSET
1,1
LINKS
MAPLE
q:= proc(n) local i, l, r; l, r:= convert(n, base, 2), 0;
for i to nops(l) while l[i]=1 do r:=r+1 od; is(r, even)
end:
select(q, [ithprime(i)$i=1..200])[]; # Alois P. Heinz, Dec 15 2019
MATHEMATICA
been1Q[n_]:=Module[{c=Split[IntegerDigits[n, 2]][[-1]]}, c[[1]]==1&&EvenQ[ Length[ c]]]; Join[{2}, Select[Prime[Range[150]], been1Q]] (* Harvey P. Dale, Dec 14 2019 *)
PROG
(PARI) is(n)=valuation(n+1, 2)%2==0 && isprime(n) \\ Charles R Greathouse IV, Oct 09 2013
CROSSREFS
Intersection of A000040 & (complement of A079523). Complement of A095283 in A000040. Cf. A027699, A095292.
Sequence in context: A111802 A213894 A294668 * A051071 A051095 A051073
KEYWORD
nonn,base,easy
AUTHOR
Antti Karttunen, Jun 04 2004
STATUS
approved