Welcome to JuliaLang Discourse!
In the first one, what about broadcasting %
?
x=[30, 31,32]
x .% 17
About the second one, broadcasting spits a result of similar size as the input, so giving two arrays comes against this. Maybe using an alternative option?
a1 = similar(x)
a2 = similar(x)
for i in eachindex(x)
a1[i], a2[i] =divrem(x[i], 17)
end