Most of these things are controlled by genetics not nutrition, but poor growing conditions, this is low nutrition and environmental stresses can cause plants to turn hermaphrodite and possibly male.
However, even plants grown with the best nutrition and without any stress can and will still become male or turn hermaphrodite...there is a bit of luck involved when growing regular seeds.
There is also a fine line between good amounts of nitrogen and too much nitrogen, with excess nitrogen causing plants that veg forever and fail to flower.
I certainly would not be limiting potassium levels at any stage of growth, especially seedlings.
Careful seedling selection is probably the most reliable method of success when it comes to growing (hopefully) females through to maturity.
Young male seedlings generally grow taller/faster and have less branch development than female seedlings which generally grow a bit slower and steadier and develop branches much sooner than males do. This seems to be a rough indication, but is not 100% reliable as I have had many plants that were slow growing and very bushy/branchy that ended up males and tall thin plant that I hoped would be males, actually turned out to be females over the last 40 years.
These days when growing regular seeds, I select my (hopefully) female seedlings, by observing them at night time. It seems female seedlngs will have their leaves folded downwards at night, where as male seedlings seem to keep their leaves more upright at night. Since noticing this behaviour some years ago, I now seem to be able to determine my females from the males with about a 90% or better success rate. This has taken some practice to understand, but if you go out at night and look at your seedlings often enough over a week or two, (after they are about a month old) these leaf up/leaf down traits will be easy to spot and hopefully you too will be able to determine your (hopefully) female seedlings from your males.
Hope this helps, Organoman.