Advertisement
Guest User

Untitled

a guest
Jan 9th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement