Determine whether a number is a Gaussian prime - MATLAB Cody - MATLAB Central

Problem 59836. Determine whether a number is a Gaussian prime

Difficulty:Rate
A Gaussian prime is a number a+bi that cannot be factored. For example, 4+7i is not a Gaussian prime because it can be factored as the product of two Gaussian primes (2+i)(3+2i). The number 41 is not a Gaussian prime because it can be factored as (5+4i)(5-4i), but the number 83 cannot be factored further.
Write a function to determine whether a number is a Gaussian prime. Just as isprime can handle matrices, your function should handle matrices too.

Solution Stats

64.29% Correct | 35.71% Incorrect
Last Solution submitted on Dec 09, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Group

YouTube-inspired Image
YouTube-inspired
  • 15 Problems
  • 2 Finishers

Problem Recent Solvers7

Problem Tags

Community Treasure Hunt

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

Start Hunting!