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

Learn moreOpportunities for recent engineering grads.

Apply TodayReturn 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.

52 correct solutions
45 incorrect solutions

Last solution submitted on Jun 22, 2016

1 player likes this problem

1 Comment

Richard
on 28 Sep 2015

I thought we had to discount all the equivalent fractions (like 2/2) so I wrote this horrible cheat. How embarrassing.

1 Comment