I made a code to try and compute the partial sum of a series, but it keeps producing a result that's about 0.01 off. It looks pretty straightforward to me and I haven't been able to spot what my mistake might've been, but there's definitely something off.
import math
def f(n):
s = 0
for x in range(1,n+1):
y = x*(4**x)
d = (math.factorial(x))*(4**x)
n = -1**x
s += n/d
print(s)
f(7)