Neim, 7 bytes
'ÏðððŽSð
Explanation:
'Ï Push 345
ð Get the characters
ð Vectorised multiply with the input
ðŽ Sum the resulting list
Sð Subtract the input
Alternative program: 3ðáððŽSð
Instead of pushing 345
and then getting the characters, creates the array [1 2 3]
using 3ð
, then add 2 to each element with á
.