Problem 60571. Find polygonal numbers that are Blum integers
A polygonal number is the number of dots arranged in the shape of a regular polygon. For example, 15 is a triangular number because dots can be arranged in the shape of a triangle with rows of 1, 2, 3, 4, and 5 dots. The number 16 is a square number because dots can be arranged in four rows of four.
A Blum integer is a semiprime—that is, the product of two distinct primes—whose factors have the form
for some integer k. The number 21 is a Blum integer because its two prime factors, 3 and 7, have the form
with
and
.
Recently JessicaR had occasion to point out the properties of the number 57 to me. She observed, among other things, that 57 is both a Blum integer (
) and an icosagonal (i.e., 20-gonal) number.
Write a function that takes as input a maximum value x and a number of sides n and returns the largest n-gonal number (i.e., polygonal number with n sides) that is a Blum integer. If there are no numbers in the range 1 to x that work, return y = [].
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
1339 Solvers
-
418 Solvers
-
Sum the entries of each column of a matrix which satisfy a logical condition.
171 Solvers
-
Create a random logical vector of N elements of which M are true.
103 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1985 Solvers
More from this Author315
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!