login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A226881 Number of n-length binary words w with #(w,0) >= #(w,1) >= 1, where #(w,x) gives the number of digits x in w. 4
0, 0, 2, 3, 10, 15, 41, 63, 162, 255, 637, 1023, 2509, 4095, 9907, 16383, 39202, 65535, 155381, 262143, 616665, 1048575, 2449867, 4194303, 9740685, 16777215, 38754731, 67108863, 154276027, 268435455, 614429671, 1073741823, 2448023842, 4294967295, 9756737701 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(n) is the number of nonempty subsets of {1,2,...,n} that contain either more even than odd numbers or the same number of even and odd numbers. For example, for n=5, a(5)=15 and the 15 subsets are {2}, {4}, {1,2}, {1,4}, {2,3}, {2,4}, {2,5}, {3,4}, {4,5}, {1,2,4}, {2,3,4}, {2,4,5}, {1,2,3,4}, {1,2,4,5}, {2,3,4,5}. - Enrique Navarrete, Dec 15 2019
LINKS
FORMULA
G.f.: (3*x-1)/(2*(x-1)*(2*x-1)) + 1/(2*sqrt((1+2*x)*(1-2*x))).
a(n) = Sum_{i=1..floor(n/2)} binomial(n,i). - Wesley Ivan Hurt, Mar 14 2015
a(n) = A027306(n)-1 = 2^(n-1)-1+((1+(-1)^n)/4)*binomial(n,n/2). - Alois P. Heinz, Dec 15 2019
EXAMPLE
a(4) = 10: 0001, 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1010, 1100.
MAPLE
a:= proc(n) option remember;
`if`(n<4, n*(n-1)*(4-n)/2, (9*(n-1)*(n-4) *a(n-1)
+(12-32*n+6*n^2) *a(n-2) -36*(n-2)*(n-4) *a(n-3)
+8*(n-3)*(3*n-10) *a(n-4))/ (n*(3*n-13)))
end:
seq(a(n), n=0..40);
MATHEMATICA
Table[Sum[Binomial[n, i], {i, Floor[n/2]}], {n, 0, 30}] (* Wesley Ivan Hurt, Mar 14 2015 *)
PROG
(PARI) a(n) = sum(i=1, n\2, binomial(n, i)); \\ Michel Marcus, Jul 15 2022
CROSSREFS
Column k=2 of A226874.
Cf. A027306.
Sequence in context: A135101 A108065 A187767 * A369781 A026336 A027913
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 21 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)