For[i = 1; list = {}, i <= 23456, i++,
l = AppendTo[list, i/Pi]]; Total@N@list
Asked
Active
Viewed 36 times
0
For[i = 1; list = {}, i <= 23456, i++,
l = AppendTo[list, i/Pi]]; Total@N@list
Sum[N[i/Pi], {i, 23456}]takes 0.00096 seconds on my machine – მამუკა ჯიბლაძე Mar 05 '20 at 10:25N[# (# - 1)/(2 Pi)] &[23456]does this in 4 flops. – Henrik Schumacher Mar 05 '20 at 10:29AppendTo. For reasons behind that, check the documentation. – Daniel Lichtblau Mar 05 '20 at 16:07