If the amount of students who listed basketball as their favorite sport is x, we have 3 times x - 17 = 487 due to that soccer has 17 fewer players than 3 times basketball. Adding 17 to both sides, we get 3*x=504 and by dividing both sides by 3, we get x=168