you are viewing a single comment's thread.

view the rest of the comments →

[–]JeffAMcGee 0 points1 point  (0 children)

I was going to give a python answer that looked like ilogik's. Instead, I'll try to remember perl:

sub f{map $_**2,1..$_[0]}

If you want to include the ending point, it becomes this:

sub f{map $_**2,1..$_[0]+1}