Guest User

Untitled

a guest
May 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. pSum(a1, d, lim) =
  2. let n1 = (lim `div` d)
  3. n2 = ((lim - a1) `div` d + 1)
  4. in if (a1 == d)
  5. then (d * n1 * (n1 + 1)) `div` 2
  6. else (n2 `div` 2) * (a1 + aN(a1, d, n2))
Add Comment
Please, Sign In to add comment