%I #20 May 05 2019 17:31:32
%S 2,3,5,7,13,17,29,31,61,97,113,127,193,241,257,449,509,769,1009,1021,
%T 2017,4093,7681,7937,8161,8191,12289,15361,16369,16381,32257,61441,
%U 64513,65521,65537,114689,130817,131009,131041,131071,520193,523777
%N Primes of the form 2^j - 2^k + 1, where j > k >= 0.
%C This sequence contains the primes that are each one more than any term of sequence A023758.
%C In binary these primes are represented, reading left to right, as some number of 1's, followed by some number of 0's (possibly no 0's), followed finally by one 1 as the rightmost digit.
%C All odd terms p satisfy the property that (p NOR (p-2))=0. - _Gary Detlefs_, May 03 2019
%H Ivan Neretin, <a href="/A152449/b152449.txt">Table of n, a(n) for n = 1..1000</a>
%p isA000079 := proc(n) local i ; RETURN( add(i,i=convert(n,base,2)) = 1 ) ; end : isA000225 := proc(n) isA000079(n+1) ; end: A007814 := proc(n) local p2,a,p ; a := 0 ; p2 := ifactors(n)[2] ; for p in p2 do if op(1,p) = 2 then a := op(2,p) ; fi; od; RETURN(a) ; end: isA023758 := proc(n) local ord ; ord := A007814(n) ; RETURN ( isA000225(n/2^ord) ) ; end: isA152449 := proc(n) local ord,np1 ; if isprime(n) then RETURN ( isA023758(n-1) ) ; else false; fi; end: for i from 1 to 100000 do p := ithprime(i) ; if isA152449(p) then printf("%d,",p) ; fi; od: # _R. J. Mathar_, Dec 05 2008
%t Select[Union[Flatten[Table[2^j-2^k+1,{j,20},{k,0,j-1}]]],PrimeQ] (* _Harvey P. Dale_, Mar 14 2018 *)
%Y Cf. A023758.
%K nonn
%O 1,1
%A _Leroy Quet_, Dec 04 2008
%E Extended by _R. J. Mathar_, _Stefan Steinerberger_ and _Ray Chandler_, Dec 05 2008