RosettaCodeData/Task/Bernoulli-numbers/Sidef/bernoulli-numbers-5.sidef
2020-02-17 23:21:07 -08:00

13 lines
265 B
Text
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

func bernoulli_print {
var a = []
for m in (0..60) {
a << 1/(m+1)
for j in (1..m -> flip) {
(a[j-1] -= a[j]) *= j
}
a[0] || next
printf("B(%2d) = %44s / %s\n", m, a[0].nude)
}
}
 
bernoulli_print()