Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 2035. Check if it is a square or cube of consecutive numbers

Created by Vivek

Check whether the element of given row vector is a square or cube of consecutive numbers.

For example

Input x=[4 27 16 25 36 343]

Output y=true

Hence all elements are the square/cube values of number 2 3 4 5 6 7.

But if x=[36 49 121 81] then y=false. Because square/cube value for 8 is missing.

Tags

Problem Group

Solution Statistics

13 correct solutions 25 incorrect solutions
Last solution submitted on Oct 27, 2014

Problem Comments