%I #15 Nov 13 2023 12:28:47
%S 3,3,15,5,15,15,63,9,15,15,63,15,63,63,255,17,23,23,63,23,63,63,255,
%T 27,63,63,255,63,255,255,1023,33,39,39,63,39,63,63,255,43,63,63,255,
%U 63,255,255,1023,51,63,63,255,63,255,255,1023,63,255,255,1023,255,1023,1023
%N Smallest number greater than n having in binary representation exactly twice the number of ones as n has in binary representation.
%C a(n) = Min{m: m > n and A000120(m) = 2*A000120(n)};
%C a(n) is odd;
%C n < a(n) < A000290(A062383(n));
%C a(A000079(n)) = A000051(n);
%C A024036 and A000225 give record values and where they occur.
%H Reinhard Zumkeller, <a href="/A179857/b179857.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%t br2[n_]:=Module[{k=If[EvenQ[n],n+1,n+2],t=2*DigitCount[n,2,1]},While[ DigitCount[ k,2,1]!=t,k=k+2];k]; Array[br2,70] (* _Harvey P. Dale_, Sep 20 2016 *)
%o (PARI) a(n) = my(k=n+1, h=hammingweight(n)); while (hammingweight(k) != 2*h, k++); k; \\ _Michel Marcus_, Nov 13 2023
%Y Cf. A000120, A086799.
%Y Cf. A000290, A062383.
%Y Cf. A000051, A000079.
%Y Cf. A000225, A024036.
%K base,nonn
%O 1,1
%A _Reinhard Zumkeller_, Jul 31 2010
%E Definition clarified by _Harvey P. Dale_, Sep 20 2016