Given a number 'n', you were tasked to mark and count all coprime lattice points at the first quadrant bounded by the points (0,0), (0,n), (n,n) and (n,0). A coprime lattice point is a point (x,y), where x and y are coprime integers.
For example for n = 15, 145 points would be marked (see figure below).
NOTE: One is coprime to all integers including zero. Except for 1, zero is not coprime to any other integer, not even to zero itself.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers11
Suggested Problems
-
22562 Solvers
-
Return unique values without sorting
1020 Solvers
-
Magic is simple (for beginners)
11643 Solvers
-
356 Solvers
-
431 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!