Let m1<m2<⋯<mn be the number of points of each colour. We call m1,m2,…,mn the colour distribution. Then m1+⋯+mn=2012 and the number of multi-coloured sets is M=m1m2…mn. We have the following observations.
(i) m1>1. For if m1=1, then m1m2…mn<m2m3…mn−1(1+mn). This means if we use n−1 colours with colour distribution m2,m3,…,mn−1,(1+mn), we obtain a larger M.
(ii) mi+1−mi≤2 for all i. For if there exists k with mk+1−mk≥3, then the colour distribution with mk,mk+1 replaced by mk+1,mk+1−1 yields a larger M.
(iii) mi+1−mi=2 for at most one i. For if there exist i<j with mi+1−mi=mj+1−mj=2, the colour distribution with mi,mj+1 replaced by mi+1,mj+1−1 yields a larger M.
(iv) mi+1−mi=2 for exactly one i. For if mi+1−mi=1 for all i, then m1+⋯+mn=nm1+2n(n−1)=2012=4⋅503. Thus n(2m1−1+n)=8⋅503. Since 503 is prime, the parity of n and 2m1−1+n are opposite and 2m1−1+n>n, we have n=8 and m1=248. The colour distribution with m1 replaced by two numbers 2,246 (using n+1 colours) yields a larger M.
(v) m1=2. If mn−mn−1=2, then from (iv), we have m1+⋯+mn=nm1+2n(n−1)+1=2012. Thus n(2m1−1+n)=2⋅2011. Since 2011 is prime, we get n=2 and m1=1005 which will lead to a contradiction as in (iv). Thus mn−mn−1=1. mi+1−mi=2 for some 1≤i≤n−2. Suppose m1≥3. Let m′=mi+2−2. Then mi<m′<mi+1 with replacing mi+2 by 2,m′ yields a larger M. Thus m1=2.
From the above analysis, with n colours, we see that the colour distribution 2,3,…,i−1,i+1,i+2,…,n+1,n+2, with 3≤i≤n, yields the maximum M. Now we have ∑mi=21(n+1)(n+4)−i=2012. Thus n2+5n−4020=2i, 3≤i≤n, i.e., n2+5n≥4026 and n2+3n≤4020. Thus n=61 and i=3. Thus the maximum is achieved when n=61 with the colour distribution 2,4,5,6,…,63.