Problem 52859. Easy Sequences 35: Cutting a donut to Semi-prime pieces

The figure below illustrates how a torus (donut shape) can be cut in pieces with only 3 cuts:
In fact, is the maximum number of pieces a torus can be sliced with 3 cuts.
Wikipedia's article on Torus, gives an amazing formula for calculating the maximum number of pieces using n number of cuts on a single Torus:
Therefore for : .
Given a cutting limit x, write a function to find all positive integers , such that is a semi-prime. A semi-prime is a positive integer that has only 2 and exactly 2 prime factors. A few example of semi-primes are: .
As an example for , the only semi-prime 's are and , therefore the function output should be .

Solution Stats

39.02% Correct | 60.98% Incorrect
Last Solution submitted on Nov 17, 2022

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers6

Suggested Problems

More from this Author116

Problem Tags

Community Treasure Hunt

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

Start Hunting!