← Goldman Sachs questions

Check if a number is divisible only by prime numbers

Filed under Goldman Sachs

Write a function to determine if a given positive integer is divisible exclusively by prime numbers (i.e., its only prime factors are the allowed ones, or more generally, check if the number's prime…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.