Find the sum of the multiples of 3 and 7 between 1 and 100

Find the sum of the multiples of 3 and 7 between 1 and 100


Dim I as Integer 'circularly refers to the variables dim sum3 As Integer' stores the multiples of 3 and dim sum7 As Integer 'stores the multiples of 7 and for I = 1 to 100' finds the multiples of 3 if I mod 3 = 0 then sum3 = sum3 + I end if 'finds the multiples of 7 if I mod 7 = 0 then sum7 = sum7 + I end if next I' prints the result print sum3, sum7 my answer should be the answer you want, right?



What is the sum of all the multiples of 3 in the 100 numbers 1-100?


=3 * (1 + 2 + 3 + 4 +... + 32 + 33) no need to explain
=3 * (1 + 33) * 33 / 2 summation formula
=1683



So what are the numbers that are smaller than 100 and are multiples of 2, 3 and 5?


30 60 90



1,2,3,5,8,13,21,34,55,… Of the top 100______ An even number


In addition to the first number, the other numbers are in accordance with: even odd odd odd odd even odd odd odd odd odd odd even odd odd odd odd odd odd even odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd odd That is, an even number and two odd numbers appear alternately, the period is 3, and (100-1) △ 3 = 33, so there are 33 even numbers