# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a110699 Showing 1-1 of 1 %I A110699 #13 Mar 16 2015 07:36:46 %S A110699 2,2,3,5,5,9,7,9,10,11,12,13,13,17,16,17,17,19,19,21,22,24,24,25,26, %T A110699 28,28,29,30,33,31,33,34,35,36,38,38,40,40,41,42,44,44,45,46,47,48,49, %U A110699 50,51,52,53,54,56,56,57,59,59,60,61,61,65,64,65,66,67,68,69,70,72,72,73 %N A110699 Binary length of the smallest prime with Hamming weight n (given by A061712). %C A110699 a(n)=n iff n belongs to A000043. %H A110699 T. D. Noe, Table of n, a(n) for n=1..1024 %F A110699 a(n) = n + A110700(n). %p A110699 with(combstruct); a:=proc(n) local m,is,s,t,r; if n=1 then return 2 fi; r:=+infinity; for m from 0 do is := iterstructs(Combination(n-2+m),size=n-2); while not finished(is) do s := nextstruct(is); t := 2^(n-1+m)+1+add(2^i,i=s); if isprime(t) then return n+m fi; od; od; return 0; end; %t A110699 A061712[n_] := A061712[n] = Module[{m, s, k, p}, For[m=0, True, m++, s = {1, Sequence @@ #, 1} & /@ Permutations[Join[Table[1, {n-2}], Table[0, {m}]]] // Sort; For[k=1, k <= Length[s], k++, p = FromDigits[s[[k]], 2]; If[PrimeQ[p], Return[p] ]]]]; A061712[1]=2; Table[IntegerDigits[A061712[n], 2] // Length, {n, 1, 100}] (* _Jean-François Alcover_, Mar 16 2015 *) %o A110699 (PARI) a(n) = {forprime(p=2,, if (hammingweight(p) == n, return(#binary(p))););} \\ _Michel Marcus_, Mar 16 2015 %Y A110699 Cf. A000043, A061712, A110700. %K A110699 nonn,base %O A110699 1,1 %A A110699 _Max Alekseyev_, Aug 03 2005 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE