Problem

Source: Moldova EGMO TST 2023

Tags: number theory



Solve the equation $$\left[\frac{x^2+1}{x}\right]-\left[\frac{x}{x^2+1}\right]=3.$$