How to use python to realize this formula? Xiaobai asks for advice!


from sympy import Sum, var, oo -sharp 
i = var('i')
formula = Sum(1/i**4, (i, 1, oo))
res = formula.doit()

result:

pi**4/90

from sympy import Sum, oo, var
k = var('k')
print(Sum(1/k**4, (k, 1, oo)).doit())

output

pi**4/90

add a little bit to the upstairs. If oo reports an error, add oo

after import above.
import math

math.pi ** 4 / 90

as for the previous infinite sum, it can't be done (although, there is np.Infinity in numpy for )

sum(map(lambda i: 1 / i**4, range(1, inf)))
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3352a-2abcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3352a-2abcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?