Help with this exercise c ++: impirment terms of the series [closed]

0

Write a program that reads an integer n> 0 and prints n terms of the series 4,12,24,40,60 ... It should also print the sum of n

    
asked by Giovanni Sobrino Perez 06.05.2017 в 16:47
source

1 answer

1

The problem is more mathematical than programming, the first thing is to guess what law the series follows. There is no unique way to achieve such a thing.

What I would do is first to see that all are multiples of four, and after dividing I have 1,3,6,10,15; these terms are separated by 2 3 4 5 ... With this you could already discover the law and therefore generate the sequence.

    
answered by 06.05.2017 / 16:55
source