OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
A. Karttunen and J. Moyer, C-program for computing the initial terms of this sequence
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
KEYWORD
nonn,base,easy
AUTHOR
Antti Karttunen, Jun 04 2004
STATUS
approved