KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can't post image, so: a[i]={(-1)^(i+1)*sin(x)*ln(x)}/{i^2*(i+1)!} The task: Need to find a1,a2,...,an. n is natural and it's given. That's the way I tried to do this: import math a=[] k=0 p=0 def factorial(n): f=1 for i in range(1,n+1): f=f*i return f def narys(n): x=input('input x: ') #x isn't given by task rules, so i think that is error else. float(x) k=(math.pow(-1,n+1)*math.sin(x)*math.log10(n*x))/(n*n*factorial(n+1)) a.append=k n=int(input('input n: ')) narys(n) for i in a: print(a[p]) p=p+1
Tags (comma-separated)
Save Edits
Cancel