Skip to main content
edited tags
Link
added 480 characters in body
Source Link

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part smaller than s (Already Solved)

  • part s occurs at most k times (Already Solved)

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff (Already Solved)

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

EDIT: Thanks to LLlAMnYP for helping me get as far as I have. Now i have a list of list of integers in descending order and would just like to to filter out all the ones that don't fit the following criterion

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part smaller than s

  • part s occurs at most k times

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part smaller than s (Already Solved)

  • part s occurs at most k times (Already Solved)

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff (Already Solved)

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

EDIT: Thanks to LLlAMnYP for helping me get as far as I have. Now i have a list of list of integers in descending order and would just like to to filter out all the ones that don't fit the following criterion

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'
added 1 character in body
Source Link

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part biggersmaller than s

  • part s occurs at most k times

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part bigger than s

  • part s occurs at most k times

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

I am trying to add multiple criterion to

IntegerPartitions[n] 

so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in descending orders and I want to eliminate all the ones that don't fit

  • Has no part smaller than s

  • part s occurs at most k times

  • If elements are Dist apart then they are at least Diff apart
    i.e list[[i]] - list[[i+Dist]] >= Diff

  • If parts are a distance d from each other and they are within c of other
    i.e if list[[i]] - list[[i + d]] <= c
    then the sum of the parts between them (and the parts themselves) is 'm' mod 'M'

I can do some individual conditions like getting part s to occur no more than k times, but I have trouble getting it to check all these conditions. Any help would be appreciated.

discerning k and n
Source Link
LLlAMnYP
  • 11.6k
  • 28
  • 68
Loading
syntax, formatting
Source Link
LLlAMnYP
  • 11.6k
  • 28
  • 68
Loading
Source Link
Loading