Intersect three sequences - MATLAB Cody - MATLAB Central

Problem 60925. Intersect three sequences

Difficulty:Rate
Most numbers have interesting properties, if you look hard enough and interpret “interesting” liberally. Let’s choose a number at random—300, say—and list some of its properties:
  1. It is divisible by the square of its largest prime factor.
  2. It is the area of a triangle with integer sides and integer area
  3. It is a folding point of the non-negative integers written in a hexagonal spiral (see below), as are 1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 19, 21, 24, etc.
A number that shares these properties is 108: (a) It is divisible by 9, or the square of its largest prime factor (3), (b) it is the area of a triangle with sides 15, 15, and 18, and (c) it is a folding point of the hexagon (it would be to the right of 75 in the hexagon below).
Write a function to determine whether a number has the three properties listed above.

Solution Stats

33.33% Correct | 66.67% Incorrect
Last Solution submitted on Jun 06, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2

Suggested Problems

More from this Author299

Community Treasure Hunt

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

Start Hunting!