FUNCTION : pntOP - Returns true if a partition into odd parts
CALLING SEQUENCE : pntOP(ptn)
PARAMETERS : ptn - partition (list of nonnegative integers)
SYNOPSIS :
pntOP(ptn) returns true if the partition ptn is a partition into
odd parts.
EXAMPLES :
> with(combinat):
> read %FUNCS.txt%:
> ptn1:=[1,3,6];
ptn1 := [1, 3, 6]
> ptnOP(ptn1);
false
> ptn2:=[1,3,3,5];
ptn2 := [1, 3, 3, 5]
> ptnOP(ptn2);
true
> ptns:=partition(9):
> ptns1:=select(ptnOP,ptns);
ptns1 := [[1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 3], [1, 1, 1, 3, 3],
[3, 3, 3], [1, 1, 1, 1, 5], [1, 3, 5], [1, 1, 7], [9]]
> printptns(ptns1);
9
`7 + 1 + 1`
`5 + 3 + 1`
`5 + 1 + 1 + 1 + 1`
`3 + 3 + 3`
`3 + 3 + 1 + 1 + 1`
`3 + 1 + 1 + 1 + 1 + 1 + 1`
`1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1`
DISCUSSION :
The ptn1=[1,3,6] is not a partition into odd parts but the
partition ptn2=[1,3,3,5] is. There are 8 partitions of 9 into
odd parts:
9, 7 + 1 + 1, 5 + 3 + 1, 5 + 1 + 1 + 1 + 1, 3 + 3 + 3,
3 + 3 + 1 + 1 + 1, 3 + 1 + 1 + 1 + 1 + 1 + 1,
and 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1.
SEE ALSO : ptnDP