This program uses an implementation of Faulhaber's formula to calculate the formula for the below sum:
Formulas are given as a fractional factor multiplying a polynomial with integer coefficients, e.g. 1/6(2n^3 + 3n^2 + n).
(Sadly, this means we don't get to see the more fascinating incarnation of this formula, 1/6(n)(n+1)(2n+1), however...)
Run the program:
python calculator.py
It will prompt for the desired p-value, the variable name to use (n by default), and whether to output fractions in the "normal" fashion — e.g. 1/6
— or to use the LaTeX-based \frac
expression.