
11 Nov
2014
11 Nov
'14
8:44 p.m.
On Tue, Nov 11, 2014 at 5:26 AM, Jack Mott
I did try this approach as well, reversing the digits and adding elements to the head, however having to use take and letting the list build up larger seems to result in slightly worse performance overall.
The list doesn't build up. The specification for Keith Numbers requires that we only sum the previous n numbers, where n is the length of the decimal encoding of the given number, so we always truncate using take before the recursive call.