(B.0.10 <- vapply(0:10, Bern, 1/2))
## [1] 1.00000000 +0.50000000 0.16666667 0.00000000 -0.03333333 0.00000000
## [7] 0.02380952 0.00000000 -0.03333333 0.00000000 0.07575758
if(requireNamespace("MASS")) {
print( MASS::fractions(B.0.10) )
## 1 +1/2 1/6 0 -1/30 0 1/42 0 -1/30 0 5/66
}
Run the code above in your browser using DataLab