For the big picture, maybe
Map(`*`, 0:2, c(1, 11, 111))
or
unlist(Map(`*`, 0:2, c(1, 11, 111)))
or more explicitly
Map(function(x, y) x*y, 0:2, c(1, 11, 111))
(I like Map better than Steve mapply because it’s not simplified by default, it’s shorter for input and works well with other functionalities documented on its manual page, such as Reduce , Filter and Negate ).
The earlier answer to a specific question, since deleted, was just 0:2 * c(1, 11, 111) , which would be much more efficient.
source share