11
1
Partition an n X n square into multiple non-congruent integer-sided rectangles. a(n) is the least possible difference between the largest and smallest area.
___________
| |S|_______|
| | | L |
| |_|_______|
| | | |
| |_____|___|
|_|_________| (fig. I)
The largest rectangle (L) has an area of 2 * 4 = 8, and the smallest rectangle (S) has an area of 1 * 3 = 3. Therefore, the difference is 8 - 3 = 5.
Given an integer n>2, output the least possible difference.
All known values of the sequence at the time of posting:
2, 4, 4, 5, 5, 6, 6, 8, 6, 7, 8, 6, 8, 8, 8, 8, 8, 9, 9, 9, 8, 9, 10, 9, 10, 9, 9, 11, 11, 10, 12, 12, 11, 12, 11, 10, 11, 12, 13, 12, 12, 12
So a(3)=2, a(4)=4, ...
Related - this related challenge allows non-optimal solutions, has time constraints, and is not code-golf.
For more information, watch this video by Numberphile

Wow, the time to run goes up steeply. – mbomb007 – 2017-01-26T01:35:21.707
@mbomb007 yes, quite expected for a brute-ish solution. I actually included a bunch of optimizations to make it more efficient. If I remove them, I could make it quite a bit smaller (and slower and hungrier). – aditsu quit because SE is EVIL – 2017-01-26T02:35:23.393