12=5+7
Since 7 and 9 are relatively prime, any number that is a multiple of both is a multiple of 7 x 9 = 63. There are 9 multiples of 63 less than or equal to 600, so this can be computed directly using Sum = 63(1 + 2 + ... + 9) which simplifies to Sum = 63 x 9 x (1 + 9)/2 from the formula for arithmetic series. Most programming languages have a built-in function which returns the quotient and the remainder when dividing integers, or you can write your own. So to generalize, denote 600 by max, 7 by a, and 9 by b. Input those values first. Suppose quotient returns the quotient of an integer division. begin N <- quotient(max, lcm(a,b)) (* N is the number of multiples of both a and b <= max *) sum <- lcm(a,b) * N * (1 + N)/2 (* Use the formula *) end This is the most efficient solution. There are other solutions that don't assume an understanding of arithmetic series. Specifically, you could write: begin i <- 1; sum <- 0 (* Initialize counter to 1 and sum to 0 *) While i <= max/lcm(a,b) do sum <- sum + i * lcm(a,b) i++; od end
The sum of the factors of any negative number is zero.
The sum of 538 and 259 is 797. The word Sum means to add.Answered by: Emilio Aranda_EL Paso, Tx (Emilioa)
3 (21+5)
sum= answer of an addition question.. so the number of the sum is the answer.
Write 567.23 as a sum ANSWER: 5x102 + 6x101 + 7x100 + 2x10-1 + 2x10-2
pablo smiths willy iz houuuumungus! its bigger than max that's how big it iz i mean its ridiculouse how big his willy is... from sum fit bird :) x
x-7
Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers
a+21
5100
Write the following as an algebraic expression using x as the variable: The sum of a number and -8
To SUM* it all up... YOUR THE BEST! HAPPY BIRTHDAY MRS./MR./MS. __________! *Also write what "sum" means :) Sum- The answer to an addition problem!
sum = 2n + 3m
Sum = 0 For N = 1 to 10 Sum = Sum + 2*N Next N Print Sum
write an assembly language program to find sum of N numbers