V
V
Valentine2020-06-16 21:56:29
Python
Valentine, 2020-06-16 21:56:29

How to calculate this sequence?

Given natural numbers m,n, real numbers A[1],A[2],...,A[m*n]. Calculate A[1]*A[2]*...*A[m]+A[m+1]*A[m+2]*...*A[2*m]+ ...+ + A[(n-1)*m+1]*A[(n-1)m+2]*...*A[n*m].

This is what the task looks like on paper 5ee91578a7212216343359.jpeg:

A python solution is preferred, but not required. Any help would be useful to me, since my problem is rather that I don’t understand how to do it purely mathematically.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-06-16
@val_gr

Mmm... what's so difficult about it?

s = 0
for i in range(0, n):
  p = 1
  for j in range(1, m+1):
    p *= a[i* m+j]
  s += p

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question