OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (7,-14,8).
FORMULA
a(n) = 2^(2n-1) + 2^n - 2.
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]
EXAMPLE
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.
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Sep 05 2008
EXTENSIONS
More terms from R. J. Mathar, Nov 03 2008
STATUS
approved