4

Find Any Integer Pair That Needs Exactly K Euclidean Divisions to Make B Zero

 8 months ago
source link: https://codeforces.com/blog/entry/123454
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Find Any Integer Pair That Needs Exactly K Euclidean Divisions to Make B Zero

By Zaoly, history, 26 hours ago,

Assume two integers and () that form an ordered integer pair . We can perform a Euclidean division on it, which will make it . If we keep performing this division, then will eventually be . We define as the number of Euclidean divisions needed to make equal .

Example: → → → → . We perform divisions until equals , so .

With the value of specified (), how to find any ordered integer pair () that needs exactly Euclidean division to make equal ? If there does not exist such a pair, report it.


I am also curious about one question: it is all known that the Euclidean algorithm is fast, but the speed of the algorithm is determined by , so may be infinitely large?


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK