Used for function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Used for function

Pleas help, c++ formula, used for function - S= 1×2+2×3+3×4+....+49×50;?

15th Nov 2020, 7:47 PM
Kaspers
5 Answers
+ 1
a*(a + 1) = a**2 + a, So S is (sum of squares from 1**2 till 49**2) + (sum from 1 till 49) now for these last two you should know the formulas
15th Nov 2020, 8:16 PM
Volodymyr Chelnokov
Volodymyr Chelnokov - avatar
+ 1
A simple "for" loop is all you need:- ...and do something like......total += i * (i+1) for the body.
15th Nov 2020, 9:17 PM
rodwynnejones
rodwynnejones - avatar
+ 1
make a sum variable make a forloop to run from 1 to 50 within the loop assign the sum to be counter*counter++
16th Nov 2020, 12:48 AM
Logomonic Learning
Logomonic Learning - avatar
0
What is the common factor of the sequence: a_n = 1*2, 2*3, 3*4, ..., 49*50? Like sequence: b_n = 1, 4, 9, ... Could have common factor of: b_n = n*n What could be the common factor of a_n?
15th Nov 2020, 8:19 PM
Seb TheS
Seb TheS - avatar
0
I saw your question and I did this code, don't know if it helps https://code.sololearn.com/cJbPK6JAEKPh/?ref=app
15th Nov 2020, 9:03 PM
Mauro Almeida
Mauro Almeida - avatar