In solving EQDIV I did not run up against any memory or size constraints. I observed the pattern that any 2^(K+1) consecutive piles can be distributed greedily to obtain a balanced distribution. I calculate the 32-bit pattern for K = 4 greedily, and then use a portion of the pattern for smaller K.
Before I describe the algorithm, note that I prepare 2 arrays of length 2^(K+2), one containing each I^K and the other the sum of all J^K for J from 1 to I for each I.
Define M = 2^(K+1), and R = N%M. I prepare an initially undefined cache of the best distribution of the first N + R piles for each R, and the corresponding difference in their sums.
For N < M, I do not cache the result, but instead calculate the best distribution by the function described below.
For N > M, I first copy the repeating pattern to define the distribution of piles from R+1 to N. I then use the cached result for the first R + N piles for this R if it exists. If the cache for this R does not exist I calculate it by the following function.
Function to evaluate best sequence for first few piles, up to 64.
Input: R
Input: Array of length R or R + N. If R + N, last N values are set to repeating distribution.
Output: Smallest difference in sums, and Array fully defined.
First distribute the first R piles greedily, working down from the largest. If the resulting difference is 0 or 1, this is the solution.
Otherwise attempt to find a better distribution by searching a binary tree of possible distributions, working down from the last item in the input array. At each level the pile may be assigned either way. To save unnecessary searching, check if (a) a better distribution is impossible even when all the smaller piles are assigned the other way, or (b) a better distribution is obtained when all the smaller piles are assigned the other way. If (b), and the better distribution results in a difference of 0 or 1, there is no need to search further, else remember the smaller difference and continue searching.
You can see my solution at CodeChef: Practical coding for everyone
which received 100 points in 0.07 seconds.