Sum 7

Algebra Level 1

What is the sum of all integers which are multiples of 7 and are between 100 and 1000?


Image credit: Wikipedia Alexander Chiba .


The answer is 70336.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

7 solutions

Shuvam Nayak
Apr 27, 2014

It is simple A.P problem. By mere inspection we get First term (a) of the series is 105 and last term (l) is 994 . By using the formula t th term = a + (n-1).d where n = no. of terms in series and d= difference which in this case is 7 ( since multiples of 7 is given ) . From this we get n = 128. Then using the sum formula of an A.P. series S(n) = (n/2 )*(a+l) we get the sum to be 70336.

Satyen Nabar
Apr 27, 2014

1st term a = 105 = 7 × 15 a =105 = 7\times 15

Last term = 994 = 7 × 142 = 994 = 7\times 142

Number of terms n = 142 15 + 1 = 128 n = 142-15 +1= 128

Difference d = 7 d = 7

S n = n / 2 ( ( 2 a + ( n 1 ) d ) S_n= n/2 (( 2a+ (n-1) d)

S n = 70336 S_n = 70336

Alternatively,

S n = n / 2 [ a + last term ] = 64 ( 105 + 994 ) = 70336 Sn = n/2[ a + \text{last term}] = 64(105 + 994) = 70336

Dev Ashish - 7 years, 1 month ago

I have made it with c programming

include<stdio.h>

int a[10000]; int main() { int sum=0,i; for(i=100;i<1000;i++) { if((i%7)==0) { a[i]=i; } } for(i=100;i<1000;i++) { printf("%d\t",a[i]); sum=sum+a[i]; } printf("%d",sum); }

Kunal Sharma
Apr 27, 2014

First term of multiple of 7 between 100 and 1000 = a = 105

Last term = L = 994

Total no. of terms = n = (994 - 105)/7 + 1 = 128

Difference between terms = d = 7

Sum of terms = S = n/2(2 a + (n-1) d) = 128/2(2 105 + (127) 7) = 64(210 + (889) = 70336

Therefore, sum of all terms of multiple of 7 between 100 and 1000 is 70,336.

Santanu Debnath
Apr 27, 2014

it is an AR FIRST OF ALL. 142x7=994, &15x7=105, so use the formula of n(n+1)/2 from 1 to 142 then subtract the summation of first 14 natural no. and the multiply this with 7 as it is a multiple of 7 . and the answer is 70336,

Amit Patel
Apr 27, 2014

c = 0
for x in range(100, 1000) :
if (x%7) == 0 :
c = c + x
print c



Landon Bland
Apr 29, 2014

I personally was feeling incredibly time wasteful today, so I wrote a reusable version in my childhood programming language, Microsoft Small Basic. Took a hundred lines, but hey, it can write the whole list of multiples of any number over any range to a CSV file if so desired, as well as calculating the product and sum of the multiples. Twenty minutes of my life down the drain...

Subroutines for the sum, where LowerLimit = 100, UpperLimit = 1000, and Factor = 7:

Sub Create_Array
 Count = 1
  For i = LowerLimit To UpperLimit
    If Math.Remainder(i, Factor) = 0 Then
      ListOfMultiples[Count] = i
      Count = Count + 1
    EndIf
  EndFor
EndSub

Sub Sum
  Total = 0
  For i = 1 To Array.GetItemCount(ListOfMultiples)
    Total = Total + ListOfMultiples[i]
  EndFor
  TextWindow.WriteLine("The sum is " + Total + ".")
EndSub

Ugly code, unnecessary code, but by gar, it did the job, it's reusable, and it was fun.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...