204k views
0 votes
how would I write a variable to represent the sum of four consecutive numbers if the least number is p

1 Answer

6 votes
Start with what we know: Our lowest number is
p and we want a sum, let's call that
S.

We know we want consecutive numbers and we want 4 of them. Numbers are consecutive if they come "one after another", that is to say: we can get from one to the other by adding or subtracting 1.

If we start with
p we can get consecutive numbers by repeatedly adding 1 (notice we aren't using the "or subtracting" part here because we know
p is our lowest number).

So: starting with
p, adding one over and over until we've got our four numbers we have:


p

p+1

(p+1)+1=p+2

(p+2)+1=p+3

And now we can write our sum:

S=p+(p+1)+(p+2)+(p+3)=4p+6



User Laurance
by
8.2k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories