U
U
Urukhayy2015-06-14 10:51:31
Programming
Urukhayy, 2015-06-14 10:51:31

How to solve the problem associated with such an arithmetic progression?

There is a sequence:
0,4,12,24,40,60
You need to find the serial number of the number 40 in this sequence, through the formula.
I tried, but the dynamic step complicates everything (that is, the step also increases).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
throughtheether, 2015-06-14
@Urukhayy

The value at the i-th place (starting from one) is 2i(i-1). If you need to find the value index, then you need to solve a quadratic equation of the form 2i(i-1)=A, where i is a variable.

D
Denis, 2015-06-14
@prototype_denis

Forgive me mathematicians, but where is the arithmetic progression?
You have a recursive function.
Fn = F(n-1) + 4n. where F from zero = 0.
PHP example

function a($n) {
    return (!$n) ? 0 : a($n - 1) + 4 * $n;
}

// a(40) === 3280

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question