Skip to content

Instantly share code, notes, and snippets.

@swuecho
Created August 2, 2012 01:20
Show Gist options
  • Select an option

  • Save swuecho/3232240 to your computer and use it in GitHub Desktop.

Select an option

Save swuecho/3232240 to your computer and use it in GitHub Desktop.
pattern
sub <sum_name>($n) {
my ($total,$k)=0,1;
while $k<=$n {
$total=$total+<term>;
$k=<suc>;
}
return $total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment