Math Flashcards
What is prime factorization?
The process of expressing a number as the product of its prime factors.
True or False: The number 1 is a prime number.
False
What is the prime factorization of 28?
2 x 2 x 7 or 2^2 x 7
Fill in the blank: The smallest prime number is ____.
2
Which of the following numbers is prime? 15, 17, 21
17
What is the time complexity of finding prime factors of a number n using trial division?
O(√n)
In C++, which header file is commonly used for input and output operations?
<iostream>
</iostream>
Write a short C++ code snippet to check if a number is prime.
bool isPrime(int n) { if (n <= 1) return false; for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) return false; } return true; }
True or False: The prime factorization of 60 is 2 x 3 x 5.
False
What is the prime factorization of 100?
2^2 x 5^2
Fill in the blank: The Sieve of Eratosthenes is an algorithm used to find ____ numbers.
prime
What is the output of the following C++ code: ‘std::cout «_space;2 * 3 + 5;’?
11
Which C++ loop is typically used to iterate over a range of numbers for factorization?
for loop
What is the prime factorization of 45?
3^2 x 5
True or False: Every integer greater than 1 can be expressed as a product of prime numbers.
True
What is the purpose of the ‘sqrt’ function in C++?
To calculate the square root of a number.
In C++, what is the keyword used to define a function?
void
What is the prime factorization of 77?
7 x 11
Fill in the blank: The number 2 is the only even ____ number.
prime
Which method would you use to factor a large number efficiently in C++?
Pollard’s rho algorithm or Sieve of Eratosthenes.
What is the prime factorization of 81?
3^4
True or False: The number 9 is a prime number.
False
What is the output of the following C++ code: ‘std::cout «_space;(5 % 2);’?
1
What is the prime factorization of 150?
2 x 3 x 5^2
Fill in the blank: The function ‘std::cin’ is used for ____ in C++.
input
What is the prime factorization of 64?
2^6