Hilbert numbers - MATLAB Cody - MATLAB Central

Problem 42830. Hilbert numbers

Difficulty:Rate

Given a positive integer, n, return h as follows:

1. If n is not a Hilbert number, return h = 0

2. If n is a Hilbert prime, return h = 1

3. If n is a Hilbert non-prime, return all of its Hilbert factors in one sorted vector.

Example 1:

n = 3

h = 0

Example 2:

n = 5

h = 1

Example 3:

n = 45

h = [5 9]

Example 4:

n = 441

h = [9 21 49]

Solution Stats

42.18% Correct | 57.82% Incorrect
Last Solution submitted on Feb 24, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers48

Suggested Problems

More from this Author45

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page