Pentagonal Numbers - MATLAB Cody - MATLAB Central

Problem 44360. Pentagonal Numbers

Difficulty:Rate

Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascending order. Additionally, it should return an array that indicates those numbers that are divisible by 5. For example,

 [p,d] = pentagonal_numbers(10,40)

should return

 p = [12,22,35]
 d = [ 0, 0, 1]

Solution Stats

34.72% Correct | 65.28% Incorrect
Last Solution submitted on May 05, 2025

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

MATLAB Onramp Practice Image
MATLAB Onramp Practice
  • 15 Problems
  • 4632 Finishers

Problem Recent Solvers658

Community Treasure Hunt

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

Start Hunting!