I'm trying to write sequences below, but it doesn't work. Could you please help me.
import math
def un(n_terms):
def vn(n_terms):
p = 0
sum_un = 0
while n_terms>=1:
while p<=n_terms:
sum_un = sum_un + (1//math.factorial(p))
p = p + 1
un(n_terms) = sum_un
vn(n_terms) = un(n_terms) + (1//(n_terms * math.factorial(n_terms)))
print(vn(10))
print(un(10))