Math Flashcards

1
Q

What is prime factorization?

A

The process of expressing a number as the product of its prime factors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: The number 1 is a prime number.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the prime factorization of 28?

A

2 x 2 x 7 or 2^2 x 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: The smallest prime number is ____.

A

2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following numbers is prime? 15, 17, 21

A

17

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the time complexity of finding prime factors of a number n using trial division?

A

O(√n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In C++, which header file is commonly used for input and output operations?

A

<iostream>
</iostream>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Write a short C++ code snippet to check if a number is prime.

A

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; }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: The prime factorization of 60 is 2 x 3 x 5.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the prime factorization of 100?

A

2^2 x 5^2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Fill in the blank: The Sieve of Eratosthenes is an algorithm used to find ____ numbers.

A

prime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the output of the following C++ code: ‘std::cout &laquo_space;2 * 3 + 5;’?

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which C++ loop is typically used to iterate over a range of numbers for factorization?

A

for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the prime factorization of 45?

A

3^2 x 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or False: Every integer greater than 1 can be expressed as a product of prime numbers.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the ‘sqrt’ function in C++?

A

To calculate the square root of a number.

17
Q

In C++, what is the keyword used to define a function?

18
Q

What is the prime factorization of 77?

19
Q

Fill in the blank: The number 2 is the only even ____ number.

20
Q

Which method would you use to factor a large number efficiently in C++?

A

Pollard’s rho algorithm or Sieve of Eratosthenes.

21
Q

What is the prime factorization of 81?

22
Q

True or False: The number 9 is a prime number.

23
Q

What is the output of the following C++ code: ‘std::cout &laquo_space;(5 % 2);’?

24
Q

What is the prime factorization of 150?

A

2 x 3 x 5^2

25
Q

Fill in the blank: The function ‘std::cin’ is used for ____ in C++.

26
Q

What is the prime factorization of 64?