Try one of the following:
my.foo <- function (input) input^2
sapply(ls(pattern = "a_"), function(x) my.foo(get(x)))
# a_1 a_2 a_3
# 4 25 49
sapply(list(a_1, a_2, a_3), my.foo)
# [1] 4 25 49
I removed the print
from your function because it results in double printing with these examples.