Python Forum
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
  • Is v_1, ... v_9 an array of numbers given as input?
  • What is delta, and what does delta(v_k) mean?
  • The whole sum seems to depend on j, let us call it S_j, how do you define it exactly (which exact terms do you add)?
  • What is the meaning of j \le delta(v_k)\le 9 at the end? it depends on two indices j and k, but k is the summation index, so how does this intervene in the sum. Is it a condition on j, on k ?
Please clarify the question if you want a meaningful answer.