OFFSET
0,6
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
FORMULA
EXAMPLE
The a(4) = 1 through a(9) = 16 partitions:
(211) (221) (411) (322) (332) (441)
(311) (2211) (331) (422) (522)
(21111) (511) (611) (711)
(3211) (3221) (3321)
(22111) (3311) (4221)
(31111) (4211) (4311)
(22211) (5211)
(32111) (22221)
(41111) (32211)
(221111) (33111)
(2111111) (42111)
(51111)
(222111)
(321111)
(2211111)
(3111111)
For example, the partition x = (2,1,1,1,1) has the permutation (1,1,2,1,1), with runs (1,1), (2), (1,1), which are not all distinct, so x is counted under a(6).
MATHEMATICA
Table[Length[Select[IntegerPartitions[n], MemberQ[Permutations[#], _?(!UnsameQ@@Split[#]&)]&]], {n, 0, 15}]
PROG
(Python)
from sympy.utilities.iterables import partitions
from itertools import permutations, groupby
from collections import Counter
def A351203(n):
c = 0
for s, p in partitions(n, size=True):
for q in permutations(Counter(p).elements(), s):
if max(Counter(tuple(g) for k, g in groupby(q)).values(), default=0) > 1:
c += 1
break
return c # Chai Wah Wu, Oct 16 2023
CROSSREFS
The version for run-lengths instead of runs is A144300.
The version for normal multisets is A283353.
The Heinz numbers of these partitions are A351201.
The complement is counted by A351204.
A005811 counts runs in binary expansion.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A297770 counts distinct runs in binary expansion.
Counting words with all distinct runs:
- A351202 = permutations of prime factors.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 12 2022
EXTENSIONS
a(26) onwards from Andrew Howroyd, Jan 27 2024
STATUS
approved