You should proceed in the same way as was proposed by Tamas, just add new column in resulting DataFrame
for i = 1:size(x,2)
result = Addition(x,y,i)
CSV.write("TestCSVPack.csv", DataFrame(:n => i, :x => result), append = i != 1, writeheader = false)
end
N.B.: as you can see, I’ve used just i, not fill(i, length(result)) because DataFrame constructor auto cycle this column, but both versions are valid. Also, you can remove writeheader argument if you want to, because CSV does not create additional header rows in append mode.