A371358
Number of binary strings of length n which have more 00 than 01 substrings.
Original entry on oeis.org
0, 0, 1, 2, 4, 10, 21, 42, 89, 184, 371, 758, 1546, 3122, 6315, 12782, 25780, 51962, 104759, 210934, 424404, 853806, 1716759, 3450158, 6932169, 13924260, 27959805, 56130762, 112662414, 226080318, 453595341, 909925794, 1825052601, 3660020992, 7339006091
Offset: 0
a(4) = 4: 0000, 0001, 1000, 1100.
a(5) = 10: 00000, 00001, 00010, 00011, 00100, 01000, 10000, 10001, 11000, 11100.
Cf.
A000079(n-2) (more 01 than 10, for n>=2).
-
b:= proc(n, l, t) option remember; `if`(n+t<1, 0, `if`(n=0, 1,
add(b(n-1, i, t+`if`(l=0, (-1)^i, 0)), i=0..1)))
end:
a:= n-> b(n, 2, 0):
seq(a(n), n=0..34); # Alois P. Heinz, Mar 20 2024
-
tup[n_] := Tuples[{0, 1}, n];
cou[lst_List] := Count[lst, {0, 0}] > Count[lst, {0, 1}];
par[lst_List] := Partition[lst, 2, 1];
a[n_] := Map[cou, Map[par, tup[n]]] // Boole // Total;
Monitor[Table[a[n], {n, 0, 18}], {n, Table[a[m], {m, 0, n - 1}]}]
-
{ a371358(n) = 2^(n-1) - sum(k=0, n\3, binomial(2*k,k) * (2*binomial(n-2*k,n-3*k) - binomial(n-2*k-1,n-3*k))) / 2; } \\ Max Alekseyev, May 01 2024
A370048
Number of binary strings of length n in which the number of substrings 00 is one more than that of substrings 01.
Original entry on oeis.org
0, 0, 1, 1, 2, 6, 10, 18, 40, 76, 141, 285, 558, 1066, 2097, 4121, 8000, 15660, 30763, 60171, 117918, 231690, 454816, 893208, 1756688, 3455580, 6799195, 13388587, 26375466, 51974798, 102470402, 202108730, 398756664, 787025260, 1553900235, 3068937675, 6062944710, 11981429394, 23683822694, 46828287038
Offset: 0
-
{ a370048(n) = (n > 1) * sum(m=0,(n-1)\3, binomial(2*m,m+1) * binomial(n-1-2*m,m) + binomial(2*m+1,m) * binomial(n-2-2*m,m) ); }
-
from math import comb
def A370048(n): return 0 if n<2 else 1+sum((x:=comb((k:=m<<1),m+1)*comb(n-1-k,m))+x*(k+1)*(n-1-3*m)//(m*(n-1-k)) for m in range(1,(n+2)//3)) # Chai Wah Wu, May 01 2024
A371570
Number of binary necklaces of length n which have more 01 than 00 substrings.
Original entry on oeis.org
0, 0, 2, 3, 6, 15, 29, 56, 118, 237, 467, 946, 1905, 3796, 7618, 15303, 30614, 61319, 122951, 246202, 492971, 987542, 1977560, 3959289, 7927969, 15873190, 31776708, 63614397, 127346134, 254908115, 510233309, 1021273672, 2044071894, 4091064805, 8187770675
Offset: 0
a(3) = 3: 011, 101, 110.
a(4) = 6: 0101, 0111, 1010, 1011, 1101, 1110.
a(5) = 15: 00101, 01001, 01010, 01011, 01101, 01111, 10010, 10100, 10101, 10110, 10111, 11010, 11011, 11101, 11110.
Cf.
A217464 (necklaces with equal 00 and 01),
A371668 (necklaces with more 00 than 01).
Cf.
A126869 (necklaces with equal 00 and 11, for n>=1),
A058622 (necklaces with more 00 than 11).
Cf.
A163493 (strings with equal 00 and 01),
A371358 (strings with more 00 than 01),
A371564 (strings with more 01 than 00).
-
tup[n_] := Tuples[{0, 1}, n];
tupToNec[n_] := Map[Append[#, #[[1]]] &, tup[n]];
cou[lst_List] := Count[lst, {0, 1}] > Count[lst, {0, 0}];
par[lst_List] := Partition[lst, 2, 1];
a[0] = 0;
a[n_] := Map[cou, Map[par, tupToNec[n]]] // Boole // Total;
Monitor[Table[a[n], {n, 0, 18}], {n, Table[a[m], {m, 0, n - 1}]}]
A371668
Number of binary necklaces of length n which have more 00 than 01 substrings.
Original entry on oeis.org
0, 1, 1, 1, 5, 11, 19, 43, 93, 181, 371, 771, 1547, 3121, 6357, 12821, 25805, 52123, 105031, 211243, 425215, 855457, 1719257, 3455153, 6942387, 13942111, 27993317, 56197117, 112785797, 226311535, 454043339, 910778203, 1826666093, 3663122277, 7344953123
Offset: 0
a(3) = 1: 000.
a(4) = 5: 0000, 0001, 0010, 0100, 1000.
a(5) = 11: 00000, 00001, 00010, 00011, 00100, 00110, 01000, 01100, 10000, 10001, 11000.
Cf.
A217464 (necklaces with equal 00 and 01),
A371570 (necklaces with more 01 than 00).
Cf.
A126869 (necklaces with equal 00 and 11, for n>=1),
A058622 (necklaces with more 00 than 11).
Cf.
A163493 (strings with equal 00 and 01),
A371358 (strings with more 00 than 01),
A371564 (strings with more 01 than 00).
-
tup[n_] := Tuples[{0, 1}, n];
tupToNec[n_] := Map[Append[#, #[[1]]] &, tup[n]];
cou[lst_List] := Count[lst, {0, 0}] > Count[lst, {0, 1}];
par[lst_List] := Partition[lst, 2, 1];
a[0] = 0;
a[n_] := a[n] = Map[cou, Map[par, tupToNec[n]]] // Boole // Total;
Monitor[Table[a[n], {n, 0, 18}], {n, Table[a[m], {m, 0, n - 1}]}]
Showing 1-4 of 4 results.
Comments