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

42 Solutions

7 Solvers

Last Solution submitted on Nov 28, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...