Problems
Here are the problem-solving sections for this chapter.
1. Sum of naturals divisible by 3 and 5
Write a program that calculates and prints the sum of all the natural numbers divisible by either 3 or 5, up to a given limit entered by the user.
2. Greatest common divisor
Write a program that, given two positive integers, will calculate and print the greatest common divisor of the two.
3. Least common multiple
Write a program that will, given two or more positive integers, calculate and print the least common multiple of them all.
4. Largest prime smaller than given number
Write a program that computes and prints the largest prime number that is smaller than a number provided by the user, which must be a positive integer.
5. Sexy prime pairs
Write a program that prints all the sexy prime pairs up to a limit entered by the user.
6. Abundant numbers
Write a program that prints all abundant numbers and their abundance, up to a number entered by the user.
7. Amicable numbers
Write a program that prints...