OFFSET
0,3
COMMENTS
These are compositions whose maximal runs R all satisfy length(R) != first(R).
No composition containing a single 1 is counted. Thus in computations, no permutation of any partition with a single 1 needs to be explored. - Michael S. Branicky, Oct 12 2025
FORMULA
G.f.: 1/(1 - Sum_{k>0} (-x^(k^2) + x^(k+k^2) + x^k)/(-x^(k^2) + x^(k+k^2) + 1)). - John Tyler Rascoe, Nov 14 2025
EXAMPLE
The a(0) = 1 through a(6) = 14 compositions:
() . (2) (3) (4) (5) (6)
(11) (111) (112) (23) (24)
(211) (32) (33)
(1111) (113) (42)
(311) (114)
(1112) (222)
(2111) (411)
(11111) (1113)
(2112)
(3111)
(11112)
(11211)
(21111)
(111111)
MATHEMATICA
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], And@@Table[Length[k]!=First[k], {k, Split[#]}]&]], {n, 0, 15}]
PROG
(Python)
from itertools import groupby
from sympy.combinatorics.partitions import IntegerPartition
from sympy.utilities.iterables import partitions, multiset_permutations
def compositions(n): yield from (c for p in partitions(n) for c in multiset_permutations(IntegerPartition(p).partition))
def cond(t): return not any(len(list(g))==k for k, g in groupby(t))
def a(n): return sum(1 for p in partitions(n) if not (1 in p and p[1] == 1) for c in multiset_permutations(IntegerPartition(p).partition) if cond(c))
print([a(n) for n in range(20)]) # Michael S. Branicky, Oct 12 2025
(PARI)
A_x(N) = {Vec(1/(1 - sum(k=1, N, (-x^(k^2)+x^(k+k^2)+x^k)/(-x^(k^2)+x^(k+k^2)+1))) + O('x^(N+1)))} \\ John Tyler Rascoe, Nov 14 2025
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 09 2025
EXTENSIONS
a(21)-a(33) from Michael S. Branicky, Oct 12 2025
a(34)-a(37) from John Tyler Rascoe, Nov 14 2025
STATUS
approved
