nth Rational Number - MATLAB Cody - MATLAB Central

Problem 1472. nth Rational Number

Difficulty:Rate
Return the nth rational number.
This is the inverse to Problem 1471. Index of a Rational number
The first ten positive rational numbers under the enumeration using cantors diagonalization argument are 1/1, 2/1, 1/2, 3/1, 2/2, 1/3, 4/1, 3/2, 2/3, 1/4.
Find the index of a positive rational number enumerated in this manner, i.e. the 6th rational number is 1/3.
Problem 2) Prev: 1471 Next: 1477

Solution Stats

56.52% Correct | 43.48% Incorrect
Last Solution submitted on Jan 18, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Problem Recent Solvers161

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page