Difference between revisions of "Faulhaber"
(Creation of page) 
(→Solution) 

Line 71:  Line 71:  
The following function creates the sum of the ''p''th powers of the first ''n'' positive integers as a ''(p + 1)''thdegree polynomial function of ''n'':  The following function creates the sum of the ''p''th powers of the first ''n'' positive integers as a ''(p + 1)''thdegree polynomial function of ''n'':  
+  
+  Notes. The ''<sub>1</sub>'' index means the last element (''<sub>2</sub>'' is the penultimate element, and so on). So it retrieves the last row of the triangle. ''x'' is the cardinality (number of elements) of ''x''.  
[[File:Faulhaber04.pngborder]]  [[File:Faulhaber04.pngborder]] 
Latest revision as of 12:14, 9 October 2019
This page is a solution to the tasks Faulhaber's triangle and Faulhaber's formula in the Rosetta Code, written in Fōrmulæ.
Contents
Description (from Rosetta Code)
Faulhaber's triangle
Named after Johann Faulhaber, the rows of Faulhaber's triangle are the coefficients of polynomials that represent sums of integer powers, which are extracted from Faulhaber's formula:
where is the nthBernoulli number. The first 5 rows of Faulhaber's triangle, are: 1 1/2 1/2 1/6 1/2 1/3 0 1/4 1/2 1/4 1/30 0 1/3 1/2 1/5 Using the third row of the triangle, we have:

Faulhaber's formula
In mathematics, Faulhaber's formula, named after Johann Faulhaber, expresses the sum of the pth powers of the first n positive integers as a (p + 1)thdegree polynomial function of n, the coefficients involving Bernoulli numbers.
Generate the first 10 closedform expressions, starting with p = 0.

Solution
The following function creates the Faulhaber's coefficients up to a given number of rows, according to the paper of Mohammad Torabi Dashti:
To show the first 10 rows of Faulhaber's triangle:
In order to show the previous result as a triangle:
The following function creates the sum of the pth powers of the first n positive integers as a (p + 1)thdegree polynomial function of n:
Notes. The _{1} index means the last element (_{2} is the penultimate element, and so on). So it retrieves the last row of the triangle. x is the cardinality (number of elements) of x.
To generate the first 10 closedform expressions, starting with p = 0:
Extra credit. Using the 18th row of Faulhaber's triangle, compute the sum: :