Advertisement
ipsBruno

(Javascript) GetTriangularNumber

Mar 13th, 2012
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  *  Copyright (c) 2012 [iPs]TeaM
  3.  *  Bruno da Silva (brunoemail@r7.com)
  4.  *  Pegar um número triangular conforme sua posição. Fórmula de Gauss
  5.  
  6.  * www.brunodasilva.com
  7.  * www.ips-team.forumeiros.com
  8. */
  9.  
  10. function getTriangle(n) {
  11.     return (n*n(n+1)) / 2
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement