Faulhaber's triangle: Difference between revisions

no edit summary
imported>Maxima enthusiast
No edit summary
Line 2,169:
0 -(3/20) 0 1/2 0 -(7/10) 0 3/4 1/2 1/10
56056972216555580111030077961944183400198333273050000</pre>
 
=={{header|Maxima|}}==
<syntaxhighlight lang="maxima">
faulhaber_fraction(n, k) :=
if n = 0 and k = 1 then 1
else if k >= 2 and k <= n + 1 then (n/k) * faulhaber_fraction(n-1, k-1)
else if k = 1 then 1 - sum(faulhaber_fraction(n, i), i, 2, n+1)
else 0;
faulhaber_row(n):=makelist(faulhaber_fraction(n,k),k,1,n+1);
/* Example */
/* triangle_faulhaber_first_ten_rows:block(makelist(faulhaber_row(i),i,0,9),table_form(%%));
[[File:Faulhaber.png|thumb]]
*/
</syntaxhighlight>
 
 
=={{header|Nim}}==