What is the fastest algorithm to determine the $n$-th number divisible by a perfect square? For example,
$n=1$, answer=$4$;
$n=2$, answer=$8$;
$n=3$, answer=$9$;
$n=4$, answer=$12$
What is the fastest algorithm to determine the $n$-th number divisible by a perfect square? For example,
$n=1$, answer=$4$;
$n=2$, answer=$8$;
$n=3$, answer=$9$;
$n=4$, answer=$12$
Copyright © 2021 JogjaFile Inc.
Sort in ascending order the elements of the set $$\bigcup_{k=2}^{\sqrt n}\left\{k^2l~\bigm|~1\le l\le\left\lfloor\frac n{k^2}\right\rfloor+1\right\}$$ and take the $n^{th}$ element.
But this might not be the most efficient algorithm.