A351638
Number of length n word structures with all distinct run-lengths using an infinite alphabet.
Original entry on oeis.org
1, 1, 1, 3, 3, 5, 17, 19, 31, 45, 177, 191, 335, 469, 733, 2679, 3063, 5129, 7445, 11431, 15667, 59025, 65301, 112379, 159827, 248185, 336913, 505683, 1660611, 1909901, 3184601, 4576771, 6994351, 9606093, 14229033, 19085255, 61388207, 69587029, 116257501, 164298495, 252820047
Offset: 0
The a(3) = 3 words are 111, 112, 122.
The a(4) = 3 words are 1111, 1112, 1222. The word 1122 is not included because both runs have the same length.
The a(6) = 17 words are 111111, 111112, 111122, 111211, 111221, 112111, 112221, 112222, 122111, 122211, 122222, 111223, 111233, 112333, 112223, 122333, 122233.
-
P(n) = {Vec(-1 + prod(k=1, n, 1 + y*x^k + O(x*x^n)))}
R(u, k) = {k*[subst(serlaplace(p)/y, y, k-1) | p<-u]}
seq(n)={my(u=P(n)); concat([1], sum(k=1, n, R(u, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)/r!) ))}
A165933
Least integer, k, whose value is n in A165413.
Original entry on oeis.org
1, 4, 35, 536, 16775, 1060976, 135007759, 34460631520, 17617985239071, 18027600169142208, 36907002795598798911, 151143401509104346210176, 1238053384151947477501575295, 20283338091738780737237428502272, 664629209970464486086782992577855743
Offset: 1
a(1) in binary is 1, a(2) in binary is 100, a(3) in binary is 100011, a(4) in binary is 1000011000, etc.
From _Gus Wiseman_, Feb 21 2022: (Start)
The terms and their binary expansions begin:
n a(n)
1: 1 = 1
2: 4 = 100
3: 35 = 100011
4: 536 = 1000011000
5: 16775 = 100000110000111
6: 1060976 = 100000011000001110000
7: 135007759 = 1000000011000000111000001111
8: 34460631520 = 100000000110000000111000000111100000
9: 17617985239071 = 100000000011000000001110000000111100000011111
(End)
A subset of
A044813 (distinct run-lengths) and of
A175413 (distinct runs).
These are the positions of first appearances in
A165413.
The version for runs instead of run-lengths is
A350952, firsts of
A297770.
A005811 counts runs in binary expansion.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct run-lengths:
-
g[n_] := Table[ {Table[1, {i}], Table[0, {n - i + 1}]}, {i, Floor[(n + If[ OddQ@n, 1, 0])/2]}]; f[n_] := FromDigits[ If[ OddQ@n, Flatten@ Most@ Flatten[ g@n, 1], Flatten@ g@n], 2]; Array[f, 14]
s=Table[Length[Union[Length/@Split[IntegerDigits[n,2]]]],{n,0,1000}]; Table[Position[s,k][[1,1]]-1,{k,Union[s]}] (* Gus Wiseman, Feb 21 2022 *)
-
def a(n): # returns term by construction
if n == 1: return 1
q, r = divmod(n+1, 2)
s = "".join("1"*i + "0"*(n+1-i) for i in range(1, q+1))
if r == 0: s = s.rstrip("0")
return int(s, 2)
print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 22 2022
A350824
Triangle read by rows: T(n,k) is the number of patterns of length n with all distinct run lengths and maximum value k, n >= 0, k = 0..floor(sqrt(8*n+1)-1/2).
Original entry on oeis.org
1, 0, 1, 0, 1, 0, 1, 4, 0, 1, 4, 0, 1, 8, 0, 1, 20, 36, 0, 1, 24, 36, 0, 1, 36, 72, 0, 1, 52, 108, 0, 1, 112, 576, 576, 0, 1, 128, 612, 576, 0, 1, 200, 1116, 1152, 0, 1, 264, 1584, 1728, 0, 1, 384, 2520, 2880, 0, 1, 700, 8064, 20736, 14400, 0, 1, 868, 9432, 22464, 14400
Offset: 0
Triangle begins:
1;
0, 1;
0, 1;
0, 1, 4;
0, 1, 4;
0, 1, 8;
0, 1, 20, 36;
0, 1, 24, 36;
0, 1, 36, 72;
0, 1, 52, 108;
0, 1, 112, 576, 576;
0, 1, 128, 612, 576;
0, 1, 200, 1116, 1152;
...
The T(5,1) = 1 pattern is 11111.
The T(5,2) = 8 patterns are 12222, 11222, 11122, 11112, 21111, 22111, 22211, 22221.
-
P(n) = {Vec(-1 + prod(k=1, n, 1 + y*x^k + O(x*x^n)))}
R(u, k) = {k*[subst(serlaplace(p)/y, y, k-1) | p<-u]}
T(n)={my(u=P(n), v=concat([1], sum(k=1, n, R(u, k)*sum(r=k, n, y^r*binomial(r, k)*(-1)^(r-k)) ))); [Vecrev(p) | p<-v]}
{ my(A=T(16)); for(n=1, #A, print(A[n])) }
A351205
Numbers whose binary expansion does not have all distinct runs.
Original entry on oeis.org
5, 9, 10, 17, 18, 20, 21, 22, 26, 27, 33, 34, 36, 37, 40, 41, 42, 43, 45, 46, 51, 53, 54, 58, 65, 66, 68, 69, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 93, 94, 99, 100, 101, 102, 105, 106, 107, 108, 109, 110, 117, 118, 119, 122, 129
Offset: 1
The terms together with their binary expansions begin:
5: 101 41: 101001 74: 1001010
9: 1001 42: 101010 75: 1001011
10: 1010 43: 101011 76: 1001100
17: 10001 45: 101101 77: 1001101
18: 10010 46: 101110 80: 1010000
20: 10100 51: 110011 81: 1010001
21: 10101 53: 110101 82: 1010010
22: 10110 54: 110110 83: 1010011
26: 11010 58: 111010 84: 1010100
27: 11011 65: 1000001 85: 1010101
33: 100001 66: 1000010 86: 1010110
34: 100010 68: 1000100 87: 1010111
36: 100100 69: 1000101 89: 1011001
37: 100101 72: 1001000 90: 1011010
40: 101000 73: 1001001 91: 1011011
For example, 77 has binary expansion 1001101, with runs 1, 00, 11, 0, 1, which are not all distinct, so 77 is in the sequence.
A011782 counts integer compositions.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A325545 counts compositions with distinct differences.
A334028 counts distinct parts in standard compositions.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
-
A351202 = permutations of prime factors.
-
q:= proc(n) uses ListTools; (l-> is(nops(l)<>add(
nops(i), i={Split(`=`, l, 1)}) +add(
nops(i), i={Split(`=`, l, 0)})))(Bits[Split](n))
end:
select(q, [$1..200])[]; # Alois P. Heinz, Mar 14 2022
-
Select[Range[0,100],!UnsameQ@@Split[IntegerDigits[#,2]]&]
-
from itertools import groupby, product
def ok(n):
runs = [(k, len(list(g))) for k, g in groupby(bin(n)[2:])]
return len(runs) > len(set(runs))
print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Feb 09 2022
Comments