+ 4

Please help me in Python programming for math.

Hello. I’m Duc Tran. My hobby is studying math and makig math programs. I want to make a program in Python that calculate Riemann zeta functions. Below is the definition of Riemann zeta function: https://wikimedia.org/api/rest_v1/media/math/render/svg/eb3dd62b1cd4528d76892f762ccb5b8b418cf0c6 Overall, Riemann zeta function of s is the sum of reciprocals of natural numbers to the s-th power. So, what I want to make is a program that will give us the Riemann zeta function value of s after inputting s. For example, INPUT: 2 OUTPUT: 1.644934066848...(depends on the number I round to, and for your information, it’s exactly pi^2/6) I didn’t finish the Python course on Sololearn. I only learned about 75% of it. Summary of what I learned in Python: for loop, while loop, if/else, define functions, filter function, map function, lambda, functions for lists, generators, decorators, etc. So, I learned to a part of “functional programming”, which includes lambda, map, filter, generators, etc. Please help me. Thank you. 😊 THIS IS NOT FOR CHEATING NOR ASSIGNMENTS.

28th May 2018, 1:58 AM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
8 Antworten
+ 6
The Riemann Zeta function is basically the sum of all reciprocals of number raised to the power of the riemann zeta function parameter right?
28th May 2018, 2:21 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
If there is no change on value despite adding stuff, then break
28th May 2018, 2:53 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
Wikipedia has some formulae that you may want to check, just scroll down
28th May 2018, 2:27 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
Or you just run a while loop until the value apparently doesn't change, then there you go
28th May 2018, 2:28 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Hello Pegasus. Yes, that's right. So, for example, Riemann zeta function of 2 is basically the sum of reciprocals of squares.
28th May 2018, 2:25 AM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
+ 2
Pegasus, I scrolled down but... what formulae do you mean??
28th May 2018, 2:43 AM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
+ 2
Pegasus, what do you mean by running a while loop until the value apparently doesn't change? Like.... how to stop it? (I mean how to use "break"?)
28th May 2018, 2:53 AM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar
+ 1
hmm... so I think I’m going to try it like... “if” and then “break”. Thank you Pegasus. 😄
28th May 2018, 3:10 AM
Duc Van Khanh Tran
Duc Van Khanh Tran - avatar