Find all possible positive integers P, which are not perfect squares, such that (floor(√P))^{3} divides P^{2}

let n = floor(sqrt(P))

Then the problem becomes one of finding all integer (n,P) such that

n^2 < P < (n+1)^2

and n^3 divides P^2

But n^3 divides P^2 only if n divides P,

which means that P is either n(n+1) or n(n+2)

(because P is between n^2 and (n^2+2n+1), non-inclusive).

If P = n(n+1), then P^2/n^3 = (n+1)^2/n = n + 2 + 1/n, so n can only be 1.

If P = n(n+2), then P^2/n^3 = (n+2)^2/n = n + 4 + 4/n, so n can only be 1,2 or 4

So the only P that work are

P = 1*(1+1) = 2

P = 1*(1+2) = 3

P = 2*(2+2) = 8

P = 4*(4+2) = 24