Exercises Related to Math
Last updated
Last updated
Create two factorial calculator programs.
The first should solve it using a while loop.
The other should solve it using a for loop.
Solution Code (Link)
Given an integer input greater than 0 (Assume that your input is greater than 0), print all its factors.
Solution Code (Link)
Given an integer input greater than 1, determine if the inputted integer is a prime number.
Solution Code (Link)
The proper divisors of a number are the factors of a number that is not equal to itself.
Example โ 12 has the proper divisors of: 1, 2, 3, 4, 6.
A perfect number is defined when the sum of a numberโs proper divisors equal to the number itself.
Find the total sum of perfect numbers under 10,000.
Solution Code (Link)
From 1 to N, where N is an integer greater one. We will output the number between [1,N] that has the most factors.
Example: From numbers 1 to 5. โ The number 4 has the most factors.
Solution Code (Link)
Given an integer input of N greater than -1, create a program that outputs the Nth Fibonacci number.
Example.
0th Fibonacci number is 0
1st Fibonnaci number is 1
10th is 55
19th is 4181
Solution Code (Link)