I'm trying to make an electromagnet in the size of about a pen, I was wondering what is the best material to use as a core to generate strongest magnetic field.
For an electromagnet, the best option available currently is soft iron or one of its variants. The champion is cobalt iron, available commercially under the name VACOFLUX.
Ferrites are less suitable because they saturate at lower flux density. Neodymium is not an option at all, because it is used in permanent magnets.
If you want to avoid the expensive cobalt iron, and you are going to use DC current, damping is not going to be an issue so I would suggest to take a typical electrical steel like N400-50A and see how high you can make that number go: 400 refers to the specific power loss through damping. You can easily purchase 800 or 1000. More damping is usually correlated to more flux density at saturation, therefore choose this as high as possible. 50 refers to 0.50mm thick sheets, so you are probably better off to choose this as high as possible as well.
I should add that the force exerted by your electromagnet is not only a question of the number of turns of the coil and the material choice. You want to optimize energy density of the system, which is BxH. Therefore you want to minimize the reluctance of the entire path of the flux. Choosing the material for your core only reduces the reluctance of that part of the flux path. Make sure you also provide a return path for the flux, otherwise worrying over your core material choice is not going to do you much good.