This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A143960 #15 Mar 11 2022 18:27:43 %S A143960 2,10,38,142,542,2110,8318,33022,131582,525310,2099198,8392702, %T A143960 33562622,134234110,536903678,2147549182,8590065662,34360000510, %U A143960 137439477758,549756862462,2199025352702,8796097216510,35184380477438,140737505132542,562949986975742 %N A143960 a(n) = the n-th positive integer with exactly n zeros and n ones in its binary representation. %H A143960 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (7,-14,8). %F A143960 a(n) = 2^(2n-1) + 2^n - 2. %F A143960 G.f.: 2*x*(1-2*x-2*x^2)/((1-x)*(1-4*x)*(1-2*x)). a(n) = 2*A099393(n-1). [_R. J. Mathar_, Nov 03 2008; G.f. corrected by _Georg Fischer_, May 12 2019] %e A143960 The first of the (10) positive integers with exactly three 0's and three 1's in their binary representation are 35 (100011 in binary), 37 (100101 in binary), 38 (100110 in binary), etc. a(3) is the third of these, which is 38. %t A143960 Table[FromDigits[Select[Sort[Permutations[Flatten[Table[{1,0},n]]]],#[[1]] == 1&][[n]],2],{n,25}] (* or *) Table[2^(2n-1)+2^n-2,{n,25}] (* or *) LinearRecurrence[{7,-14,8},{2,10,38},25] (* The second and third programs are much faster than the first. *) (* _Harvey P. Dale_, Mar 11 2022 *) %Y A143960 Cf. A099393. %K A143960 base,nonn %O A143960 1,1 %A A143960 _Leroy Quet_, Sep 05 2008 %E A143960 More terms from _R. J. Mathar_, Nov 03 2008