var sum = function(i)
{
  if (i == 1)
  {
    return i; 
  }
  else 
  {
    
   return i + arguments.callee(i-1); 
  }
}
alert(sum(3));
​