Posts

Showing posts from July 23, 2013

Print at least 5 possible values

Image
Problem-1: ·          An ice cream truck visits Mr. Akhtar's neighborhood every 4 days during the summer. Unfortunately, he missed it today. When can Mr. Akhtar expect the ice cream truck to visit her neighborhood again? Print at least 5 possible values.    Problem-2: ·          During the summer months, one ice cream truck visits Adina's neighborhood every 4 days and another ice cream truck visits her neighborhood every 5 days. If both trucks visited today, when is the next time both trucks will visit on the same day? Hints: To find the Least Common Multiple of two or more whole numbers, follow this procedure: Make a list of multiples for each whole number. Continue your list until at least two multiples are common to all lists. Identify the common multiples. The Least Common Multiple (LCM) is the smallest of these common multiples Find the LCM of 12

Print and Sum of all the Multiples of 3 or 5 up to 999

Print and Sum of all the Multiples of 3 or 5 up to 999. Hints: For example, to find the multiples of 3, multiply 3 by 1, 3 by 2, 3 by 3, and so on. To find the multiples of 5, multiply 5 by 1, 5 by 2, 5 by 3, and so on. The multiples are the products of these multiplications. Some examples of multiples can be found below. In each example, the counting numbers 1 through 8 are used. However, the list of multiples for a whole number is endless. Example 1:   Find the multiples of the whole number 4. Multiplication:   4 x 1 4 x 2 4 x 3 4 x 4 4 x 5 4 x 6 4 x 7 4 x 8 Multiples of 4:   4 8 12 16 20 24 28 32 Solution:   The multiples of 4 are 4, 8, 12, 16, 20, 24, 28, 32,... Example 2:   Find the multiples of the whole number 5. Multiplication:   5 x 1 5 x 2 5 x 3

What is the value of the first triangle number to have over 499 divisors?

Image
What is the value of the first triangle number to have over 499 divisors? Show the value using C or C++ or JAVA. Hints: A .  Triangular numbers are numbers that create triangles.  In other words 1, 3, 6, 10, 15, 21, etc. B .  Triangular numbers can be calculated by 1, 1+2, 1+2+3, 1+2+3+4, etc. C .  The n th triangular number can be calculated by the equation:   1 + 2 + ... + n = n (n+1) /2 D . We may say that t he sequence of triangle numbers is generated by adding the natural numbers. So the 7 th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... E . Let us list the factors of the first seven triangle numbers:  1 : 1  3 : 1,3  6 : 1,2,3,6 10 : 1,2,5,10 15 : 1,3,5,15 21 : 1,3,7,21 28 : 1,2,4,7,14,28 We can see that 28 is the first triangle number to have over five divisors. Source Code: