7 kyu

Recurring Rectangle Ratio

52 of 113dfhwze

Description:

Disclaimer

If you're not into math, you might want to skip this kata.

Property

Some rectangles have a recurring ratio of side lengths (the most famous example is A-series paper). For some of them, when removing a number of inner squares (each such square must have the side length of the smallest side of the rectangle), the ratio a / b is the same as b / c.

Example (n = 1)

Task

Given the number of inner squares to remove from such rectangle n, what is value of the ratio of the longer side over the smaller side? Don't round your result.

  • 1 ≤ n ≤ 1000
Puzzles
Mathematics
Geometry

Similar Kata:

Stats:

CreatedFeb 29, 2024
PublishedFeb 29, 2024
Warriors Trained670
Total Skips37
Total Code Submissions331
Total Times Completed113
JavaScript Completions52
Python Completions74
Total Stars12
% of votes with a positive feedback rating90% of 30
Total "Very Satisfied" Votes25
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes1
Total Rank Assessments7
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • dfhwze Avatar
  • Mednoob Avatar
Ad