[][src]Function frank::sequence_square_sum

pub fn sequence_square_sum(upto: usize) -> usize

fn seq_sum_of_squares(usize_n) uses discrete calculus to compute the sum of 1^2 + 2^2 + 3^2... n^2 --> (2n^3 + 3n^2 + n)/6 without the repetition of adding each element by way of a tiny bit of discrete calculus. Overflow possible for large n like 3810776 for 64bit usize. useful for certain comparisions, or do twice and subtract for a partial sum of squares between say 23901^2 and 24824^2.