Sum of changing general term - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Sum of changing general term (/thread-39729.html) |
Sum of changing general term - Vantin19 - Apr-03-2023 Good evening everyone, I want to compute every possible result of this sum: \[ v= \sum_{k=1}^j 9 + \sum_{k=1}^{10-j} \delta(v_k) = 2\cdot 40 \text{ where } j \leq \delta(v_k) <9 \] Moreover 1<=j<=8 (see the sum compiled write with latex in attachment) My attempt is: [j for j in range (0,8+1,1) for i in range(0,10) if (9*j +(10-j)*(j+i)==80 and (j+i)<9) ]But this attempt assume every integer delta(v_1)=delta(v_2)=delta(v_{10-j}) are the same and its not always the case RE: Sum of changing general term - Vantin19 - Apr-03-2023 Sorry I want to compute every possible result compare if it's equal to 80 and store j if it's the case RE: Sum of changing general term - Gribouillis - Apr-04-2023 Sorry, but the problem is very badly explained
|