read `W:\Cl2.txt` Help() Comp(n,S),NuC(n,S),SeqNuC(N,S),GFS(S,t),CompC(n,C),NuCompC(n,C),\ SeqNuCompC(N,C) PartitionsC1:=proc(n,m,C) local T,s,T1,t1: option remember: if m<=0 then RETURN({}): elif n=m then RETURN({[m]}): elif nevalb(1=1)) {[3, 3], [3, 2, 1], [3, 1, 1, 1]} PartitionsC:=proc(n,C) local m,T,T1: T:={}: for m from 1 to n do if C(m)=true then T1:=PartitionsC1(n,m,C): T:=T union T1: fi: od: end: PartitionsC(7,m->evalb(1=1)) {[7], [4, 3], [5, 2], [6, 1], [3, 2, 2], [3, 3, 1], [4, 2, 1], [5, 1, 1], [2, 2, 2, 1], [3, 2, 1, 1], [4, 1, 1, 1], [2, 2, 1, 1, 1], [3, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]} PartitionsC(7,m->evalb(m mod 2=1)) {[7], [3, 3, 1], [5, 1, 1], [3, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1] } NuPartitionsC1:=proc(n,m,C) local T,s,T1: option remember: if m<=0 then RETURN(0): elif n=m then RETURN(1): elif nevalb(1=1)) 15 NuPartitionsC(7,m->evalb(m mod 2=1)) 5 SeqNuPartitionsC:=proc(N,C) local n: [seq(NuPartitionsC(n,C),n=0..N)]: end: SeqNuPartitionsC(30,m->evalb(m mod 5=1 or m mod 5=4)) # A003114 [1, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 14, 17, 19, 23, 26, 31, 35, 41, 46, 54, 61, 70, 79, 91, 102, 117] SeqNuPartitionsC(30,m->evalb(m mod 5=2 or m mod 5=3)) # A003106 [1, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 6, 6, 8, 9, 11, 12, 15, 16, 20, 22, 26, 29, 35, 38, 45, 50, 58, 64, 75] SeqNuPartitionsC(30,m->evalb(m mod 7=1 or m mod 7=2 or m mod 7=4)) # Not on OEIS [1, 1, 2, 2, 4, 4, 6, 6, 10, 11, 15, 17, 23, 26, 32, 37, 47, 54, 66, 76, 93, 105, 126, 143, 172, 194, 230, 261, 306, 345, 401]