Cody

Problem 45988. Evaluate the zeta function for real arguments > 1

Solution 2631958

Submitted on 30 Jun 2020 by ChrisR
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 3/2; z_correct = 2.612375348685488; assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

2   Pass
x = 2; z_correct = pi^2/6; assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

3   Pass
x = 3; z_correct = 1.202056903159594; assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

4   Pass
x = 4; z_correct = pi^4/90; assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

5   Pass
x = 5; z_correct = 1.036927755143370; assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

6   Pass
B = [1/6 -1/30 1/42 -1/30 5/66 -691/2730 7/6 -3617/510 43867/798 -174611/330]; n = randi(10); x = 2*n; z_correct = (-1)^(n+1)*B(n)*(2*pi)^(2*n)/(2*factorial(2*n)); assert(abs(zeta1(x)-z_correct)/z_correct < 1e-8)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!