After further research, I have found a new function in IP7 that simplifies the generation of Bernoulli numbers:
The second argument, 1, in
DisplayHelpTopic "zeta"
function fBernoulli(n)
variable n
if(n==0)
return 1
elseif(n==1)
return -0.5
elseif(mod(n,2)!=0) // n>1 is odd here
return 0
else // n>1 is even here
return (-1)^(n/2-1)*factorial(n)*2*zeta(n,1,400)/( ((2*pi)^(n)) )
endif
end
The second argument, 1, in
zeta(n,1,400) makes it the Riemann zeta function; the third argument improves the precision for small 'n'.October 2, 2017 at 08:18 am - Permalink