Would finding the sum as a function of n count as a fast algorithm?
S(n) = (4n³-n)/3
The floors from each n-1 to n have a sum n(2n+1) wolfram alpha gives the full sum from 1 to n-1 as (4n³-3n²-n)/6 The ceilings from each n-1 to n have a sum n(2n-1) wolfram alpha gives the full sum from 1 to n as (4n³+3n²-n)/6