a342237T :: Integer -> Integer -> Integer
a342237T = Memo.memo2 Memo.integral Memo.integral a342237T' where
  a342237T' n 1 = 0
  a342237T' n k
    | even k = n * a342237T n (k - 1) + n^(k `div` 2) - a342237T n (k `div` 2)
    | odd k  = n * a342237T n (k - 1) + n^(k `div` 2 + 1) - a342237T n (k `div` 2 + 1)
a342237T :: Integer -> Integer -> Integer
a342237T = Memo.memo2 Memo.integral Memo.integral a342237T' where
  a342237T' n 1 = 0
  a342237T' n k
    | even k = n * a342237T n (k - 1) + n^(k `div` 2) - a342237T n (k `div` 2)
    | odd k  = n * a342237T n (k - 1) + n^(k `div` 2 + 1) - a342237T n (k `div` 2 + 1)
a342237T = Memo.memo2 Memo.integral Memo.integral a342237T' where
  a342237T' n 1 = 0
  a342237T' n k
    | even k = n * a342237T n (k - 1) + n^(k `div` 2) - a342237T n (k `div` 2)
    | odd k  = n * a342237T n (k - 1) + n^(k `div` 2 + 1) - a342237T n (k `div` 2 + 1)