Guest User

Untitled

a guest
Sep 18th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.05 KB | None | 0 0
  1. def calc(n)
  2.     2*(n*(n-1) + (1..n).inject(:+))
  3. end
Advertisement
Add Comment
Please, Sign In to add comment