STATUS
reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
... Q = []
... for comp in Compositions(n) :
...... if len(comp) == 1 or all([ comp[k] != comp[k+1] for k in range(-1, len(comp)-1) ]):
......... Q.append(comp)
... print (len(Q), ", ", )
approved
editing
proposed
approved
editing
proposed
terms = 39;
gf = 1 + Sum[x^k/(1 + x^k)^2, {k, 1, terms}]/(1 - Sum[x^k/(1 + x^k), {k, 1, terms}]) + Sum[x^(2 k)/(1 + x^k), {k, 1, terms}] + O[x]^terms;
CoefficientList[gf, x] (* Jean-François Alcover, Dec 30 2017 *)
approved
editing
proposed
approved
editing
proposed
Number of compositions of n so such that no two adjacent parts are equal, and the first part is not equal to the last part if there is more than one part.
approved
editing