Ideals generated by three elements