Faulhaber's formula: Difference between revisions

Content added Content deleted
m (Renamed "seq[fraction]" as "FaulhaberSequence".)
m (→‎{{header|Python}}: Regularize non-standard header markup)
Line 2,140: Line 2,140:
</pre>
</pre>


== {{header|Python}} ==
=={{header|Python}}==


The following implementation does not use [https://en.wikipedia.org/wiki/Bernoulli_number Bernoulli numbers], but [https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling numbers of the second kind], based on the relation: <math>m^n=\sum_{k=0}^n S_n^k (m)_k=\sum_{k=0}^n S_n^k k!{m\choose k}</math>.
The following implementation does not use [https://en.wikipedia.org/wiki/Bernoulli_number Bernoulli numbers], but [https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling numbers of the second kind], based on the relation: <math>m^n=\sum_{k=0}^n S_n^k (m)_k=\sum_{k=0}^n S_n^k k!{m\choose k}</math>.