OFFSET
1,4
COMMENTS
Given a set of integers representing the number of cookies in jars, The Cookie Monster number is the minimum number of moves Cookie Monster must use to empty the jars when in one move he may choose any subset of jars and take the same number of cookies from each of those jars.
Partitions have Cookie Monster number 2 if either they have two distinct values, or they have three distinct values, where the largest value is the sum of the other two.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
L. M. Braswell and T. Khovanova, Cookie Monster Devours Naccis, arXiv:1305.4305 [math.HO], 2013.
EXAMPLE
If there are 7 cookies, the total number of partitions is 15. Two partitions, (1,1,1,1,1,1,1) and (7), correspond to Cookie Monster number 1 (they have one value). One partition (1,2,4) has Cookie Monster number 3 (it has three values and the largest is not the sum of the other two). Other partitions have Cookie Monster number 2, so a(7)=12.
MATHEMATICA
Table[Length[
Select[IntegerPartitions[n],
Length[Union[#]] ==
2 || (Length[Union[#]] == 3 &&
Union[#][[3]] == Union[#][[1]] + Union[#][[2]]) &]], {n, 50}]
PROG
(PARI) a(n)={sum(k=1, n-1, sumdiv(k, i, sumdiv(n-k, j, if(i<j, min(k/i, (n-k)/j)))))} \\ Andrew Howroyd, Apr 29 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Leigh Marie Braswell and Tanya Khovanova, May 25 2013
STATUS
approved