1

$ks^2 = hw : k, s, h, w \in \mathbb{Z}^+ $

Suppose I want to maximize $k$ and minimize $s$ for a given $h, w$. In that case, the solution is trivial: $s=1, k=hw$, But, I want to find $k, s$ given a value of $h, w$ such that $k$ has the least possible value and $s$ has the highest possible value satisfying the above equation. How can I approach this? In many cases, solutions other than s=1 may not exist, for example, h=5, w=7. How can I mathematically validate whether other solutions exist or not?

Lets take an practical example: Lets say, I want to represent a rectangle of size $(h,w)$ as a grid of the largest possible square with side s. Where no. of squares in the grid is $k$. Now, I want to the what would the largest possible value of $s$ with $k$ also being a positive integer.

tachyon
  • 121
  • 4
  • Not quite sure what you want to do , but you basically need the prime factorizations of $h$ and $w$ to determine the possible solutions $(k,s)$ – Peter Jun 13 '22 at 10:39
  • Lets say I want to represent a rectangle of size $(h, w)$ as a grid of the largest possible square with side $s$. Where no. of squares in the grid is $k$. @Peter Would you kindly explain how prime factorization will help to solve this? – tachyon Jun 13 '22 at 12:17

0 Answers0