Hi Dan, Sorry i'm a little late with this, but I have often wondered this too.
I've usually gone with the max temp the beer reached, so in your example i would put in 21.
My understanding of the reason for including the temp is that colder solutions can have more gas dissolved in it, CO2 for example.
So if your beer fermented at 13 degrees there would be a certain amount of carbon dioxide dissolved in the fermenting beer as a result of the fermentation process. If you raise the temperature of the beer once the fermentation is complete, the ability of the liquid to keep that amount of CO2 is solution is reduced as the temperature is increased. This CO2 is vented - either through your airlock or glad wrap or whatever.
If you then drop the temp back down to your ferment temperature or lower, then the ability of the liquid to hold CO2 is again increased, but as the yeast isn't producing any more CO2, (or at least very little) that potential isn't again realised. ie the liquid can hold more CO2 again, but as the yeast has stopped making CO2, so the beer is 'flat'.
I'm not sure that the above reasoning is correct, so if someone else can correct me, that would be good.
Cheers,