I have bought a pen -- that relates to the present. You've recently bought a pen, and you have it.
If you have since lost it, then your first part needs to be past perfect. You bought it before you lost it.
You could possibly use simple past for the first part, but in this case, I'd prefer the past.
Student or Learner