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:








∑

k
=
1


n



k

p


=


1

p
+
1




∑

j
=
0


p





(



p
+
1

j


)




B

j



n

p
+
1
−
j




{\displaystyle \sum _{k=1}^{n}k^{p}={1 \over p+1}\sum _{j=0}^{p}{p+1 \choose j}B_{j}n^{p+1-j}}




where 




B

n




{\displaystyle B_{n}}

 is the nth-Bernoulli 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:






∑

k
=
1


n



k

2


=


1
6


n
+


1
2



n

2


+


1
3



n

3




{\displaystyle \sum _{k=1}^{n}k^{2}={1 \over 6}n+{1 \over 2}n^{2}+{1 \over 3}n^{3}}





 Task
 show the first 10 rows of Faulhaber's triangle.
 using the 18th row of Faulhaber's triangle, compute the sum: 




∑

k
=
1


1000



k

17




{\displaystyle \sum _{k=1}^{1000}k^{17}}

 (extra credit).
 See also

 Bernoulli numbers
 Evaluate binomial coefficients
 Faulhaber's formula (Wikipedia)
 Faulhaber's triangle (PDF)


   faulhaberTriangle=: ([: %. [: x: (1 _2 (p.) 2 | +/~) * >:/~ * (!~/~ >:))@:i.

   faulhaberTriangle 10
    1     0    0     0     0     0   0   0   0    0
  1r2   1r2    0     0     0     0   0   0   0    0
  1r6   1r2  1r3     0     0     0   0   0   0    0
    0   1r4  1r2   1r4     0     0   0   0   0    0
_1r30     0  1r3   1r2   1r5     0   0   0   0    0
    0 _1r12    0  5r12   1r2   1r6   0   0   0    0
 1r42     0 _1r6     0   1r2   1r2 1r7   0   0    0
    0  1r12    0 _7r24     0  7r12 1r2 1r8   0    0
_1r30     0  2r9     0 _7r15     0 2r3 1r2 1r9    0
    0 _3r20    0   1r2     0 _7r10   0 3r4 1r2 1r10

   NB.--------------------------------------------------------------
   NB. matrix inverse (%.) of the extended precision (x:) product of

   (!~/~ >:)@:i. 5   NB. Pascal's triangle
1 1  0  0 0
1 2  1  0 0
1 3  3  1 0
1 4  6  4 1
1 5 10 10 5

   NB. second task in progress
   
   (>:/~)@: i. 5    NB. lower triangle
1 0 0 0 0
1 1 0 0 0
1 1 1 0 0
1 1 1 1 0
1 1 1 1 1
   
   (1 _2 p. (2 | +/~))@:i. 5   NB. 1 + (-2) * (parity table)
 1 _1  1 _1  1
_1  1 _1  1 _1
 1 _1  1 _1  1
_1  1 _1  1 _1
 1 _1  1 _1  1
   