Ctrl K

Only Factors 2, 3 and 5

Easy
You get an integer value. Return True if it is positive and its prime factorization uses only 2, 3 and 5 (each any number of times, including zero). Otherwise return False. The number 1 qualifies, since it has no prime factors. Zero and negative numbers never qualify.
Example 1
value=60 → True

60 = 2 · 2 · 3 · 5, only the allowed factors.

Example 2
value=1 → True

1 has no prime factors at all, so the answer is True.

Example 3
value=22 → False

22 = 2 · 11, and 11 is not on the list.

Constraints
  • -2³¹ ≤ value ≤ 2³¹ − 1
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsA Number That Reads Both Ways EasyValue of a Roman Numeral EasyAdd One to a Digit Array EasySum of Binary Strings EasyWhole Square Root Easy
loading Python…
Input
value=60
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 64 tests on the server, hidden ones included.