Alternative way to create following array raised to powers?

You can use broadcasting with one dimension for each input array:

julia> [-1 0 1] .^ (0:3)
4×3 Matrix{Int64}:
  1  1  1
 -1  0  1
  1  0  1
 -1  0  1
5 Likes