Problem 1283. Points on a Sphere

Given a sphere of radius R, determine how many points on the surface of that sphere have three integer coordinates. Do not output the actual coordinates, but just the number of points.

For example, a sphere of radius 1 has 6 points with three integer coordinates:

  • (1,0,0)
  • (-1,0,0)
  • (0,-1,0)
  • (0,1,0)
  • (0,0,1)
  • (0,0,-1)

Your output of surface_points(1) would be 6. Good luck!

Solution Stats

36.59% Correct | 63.41% Incorrect
Last solution submitted on Jul 15, 2017

Problem Comments

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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!