aに3が代入されたら[0, 1, 8]を返すとかそんなの?だったら

irb(main):001:0> def f(a); [0, 1, 2].map{|e| e ** a }; end
=> nil
irb(main):002:0> f 3
=> [0, 1, 8]