1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Free_Kalibri [48]
3 years ago
10

An arithmetic progression is a sequence of numbers in which the distance (or difference) between any two successive numbers if t

he same. This in the sequence 1, 3, 5, 7, ..., the distance is 2 while in the sequence 6, 12, 18, 24, ..., the distance is 6. Given the positive integer distance and the positive integer n, associate the variable sum with the sum of the elements of the arithmetic progression from 1 to n with distance distance. For example, if distance is 2 and n is 10, then sum would be associated with 25 because 1+3+5+7+9 = 25.
Mathematics
2 answers:
earnstyle [38]3 years ago
3 0

Answer:

Step-by-step explanation:

Solution:

- We are to write a program for evaluating the sum to Nth of an arithmetic sequence such that the sequence starts from positive integer 1, 3 , 5 , 7 , .. n.

- The sum to nth for the arithmetic series is given by two parameters i.e first integer a = 1 and the distance between successive integers d = 2 in our case.

- For any general distance d we can write our sum to nth as:

          Sum to nth = a + (a+d) + (a+2*d) + (a+3*d) .... (a + (n-1)*d)

- From above sequence we can see that every successive number is increased by distance d and added in previous answer.

- We will use an iteration loop for a variable "sum", which is cycled by a "range ( , , )" function.

- The parameters of the range functions corresponds to:

                   range ( first integer , last integer , step size )  

                   range ( a , n + 1 , d )

- Then we can cast the loop as follows:

 " int sum = 0

   int d = 2

   int a = 1

      for i in range ( a , n + 1 , d )

            sum += i

  "

- We see that iteration parameter i starts from a = 1, with step size d = 2 and the sum is previously stored sum value plus i for the current loop.

monitta3 years ago
3 0

Answer:

def arithmetic (n, dist):

           sum = 0

           for num in range(1, n + 1, dist):

                    sum += num

           print(sum)

arithmetic(10, 2)

Step-by-step explanation:

The question asked us to write a program given the positive integer n, and positive integer distance and then associate the variable sum with the sum of the elements of the arithmetic progression from 1 to n with distance.

using python the code can be written as:

def arithmetic (n, dist):

I wrote a function that accept 2 argument n the positive integer and the distance , dist.

sum = 0

The sum is equal to 0 at the beginning.

for num in range(1, n + 1, dist):

The code loop through the number in the range of 1 to the n value with a distance value.

sum += num

The looped value are then added to the sum value to get the sum.

print(sum)

The sum are printed

arithmetic(10, 2)

The function is called and filled with the required argument . In our case the positive integer n is inputted and the distance value.

You might be interested in
To find sales tax multiply the cost of an item by 0.05.
krek1111 [17]

Answer: sales tax is calculated by multiplying the price of an item by 8.5%

Step-by-step explanation:

5 0
3 years ago
If x+y=1 and x/y=1 , what is the product of x and y?
Lostsunrise [7]

Answer: g

Step-by-step explanation: 1

2

1

2

=(

1

2

)(

2

1

)

=

(1)(2)

(2)(1)

=

2

2

=1

7 0
3 years ago
What is the difference between 1-var stats and 2-var stats?
tatiyna
<span>"1-var stats" is defined as the one that is  principally focused on the allocation of some random variable
  "2-var is defined as the of course instead be interested in the relationship between the distributions of two random variables
hope it helps</span>
5 0
3 years ago
How to find the median with a easy explanation?
Westkost [7]

Answer:

Step-by-step explanation:

The median is the middle score of a distribution. To calculate the median

Arrange your numbers in numerical order.

Count how many numbers you have.

If you have an odd number, divide by 2 and round up to get the position of the median number.

If you have an even number, divide by 2. Go to the number in that position and average it with the number in the next higher position to get the median.

Consider this set of numbers: 1, 3, 3, 6, 7, 8, 9. Since you have an odd number of scores, the median (middle number) would be 6.

What happens when you have an even number of scores so there is no single middle score? Consider this set of numbers: 1, 2, 2, 4, 5, 7. Since there is an even number of scores, you need to take the average of the middle two scores, calculating their mean

in this case, the mean would be 2 + 4 (add the two middle numbers), which equals 6. Then, you take 6 and divide it by 2 (the total number of scores you added together), which equals 3. So, for this example, the median is 3.

6 0
3 years ago
What is the GCF of 40 and 21
trasher [3.6K]
40 and 21 do not have common factors, except for one. So the answer is 1.
5 0
3 years ago
Read 2 more answers
Other questions:
  • 1. What is the area of a circle with a diameter of 12.6 in.?
    7·1 answer
  • What is 4÷3/5? <br>A. 6 <br>B. 6 2/5 <br>C. 6 2/3 <br>D. 8
    12·2 answers
  • Disco Fever is randomly found in one half of one percent of the general population. Testing a swatch of clothing for the presenc
    9·1 answer
  • Peter bought 45 greeting cards at 3 for $2.00. he sold them for 5 for $4.00. how much did he make
    12·2 answers
  • Suppose you invested $500 at an annual interest rate of 7.1 compounded continuously. How much will you have in the account after
    9·1 answer
  • Lily Quinn makes $12.50 and hour. She works four hours on Monday, six hours on Tuesday, nine hours on Wednesday, three hours on
    7·2 answers
  • 12 = q + 7 omg helppp
    13·1 answer
  • Please answer attached photo!
    8·1 answer
  • The average number of employees that call in sick for the day over the course of a year is 25.
    11·2 answers
  • As fast as possible just woke up and the math teacher wants the homework now
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!