Solution:
Answer: 2014
Label the jars 1,2,…,2017. I claim that the answer is 2014. To show this, we need both a construction and an upper bound.
For the construction, for 1≤i≤201, put a coin in the jars 10i+1,10i+2,…,10i+10. After this, each of the jars 1,2,…,2010 has exactly one coin. Now, put a coin in each of the jars 2008,2009,…,2017. Now, the jars 1,2,…,2007,2011,2012,…,2017 all have exactly one coin. This gives a construction for N=2014 (where d=1).
Now, we show that this is optimal. Let c1,c2,…,c2017 denote the number of coins in each of the jars. For 1≤j≤10, define
sj=cj+cj+10+cj+20+…
Note that throughout the process, s1=s2=⋯=s10. It is also easy to check that the sums s1,s2,…,s7 each involve 202 jars, while the sums s8,s9,s10 each involve 201 jars.
Call a jar good if it has exactly d coins. If there are at least 2015 good jars, then one can check that it is forced that at least one of s1,s2,…,s7 only involves good jars, and similarly, at least one of s8,s9,s10 only involves good jars. But this would mean that 202d=201d as all si are equal, contradiction.