problem 14

using DP with a Map to record all collatz to prevent recalculation