OFFSET
1,1
COMMENTS
a(n)=n iff n belongs to A000043.
LINKS
T. D. Noe, Table of n, a(n) for n=1..1024
FORMULA
a(n) = n + A110700(n).
MAPLE
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;
MATHEMATICA
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 *)
PROG
(PARI) a(n) = {forprime(p=2, , if (hammingweight(p) == n, return(#binary(p))); ); } \\ Michel Marcus, Mar 16 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Max Alekseyev, Aug 03 2005
STATUS
approved