r-process, s-process.. It all depends on the mass of the star, the s-process occures in stars from 0.6-10 solar masses and the r-process occurres in supernove explosion in stars that have mass ~>= 8 solar masses.
So a star that has ~>= 8 solar masses will be able to fuse iron into uranium once the star "blows up" and then the surrounding space will contain little bits of uranium, and the s-process will only work in the inert carbon core and will only produce elements up to bismuth, any higher then that will produce unstable nuclei which have a very fast decay time. (
source, the last two paragraphs of the page)
All stars begin with 70-75% hydrogen and 25-30% helium (with other small percentages of heavier elements) and then they go through the main sequence which will consist of the fusion of four hydrogen atoms (~1*4 atomic weight) to create one helium atom (~4 atomic weight), this will happen until the core of the star reaches a point where it is mainly composed of hydrogen burning in a thin shell around a helium core; once this happens, the outer layer of a star will star to grow outward due to the high temperature of the core caused by the electron degeneracy, this will cause the core to ignite helium which will cause the star to flash, marking the end of the main sequence. This will happen to stars with a minimum weigh of 0.4 solar masses, if the star is not massive enough then it will never reach the degenerate point to fuse helium and we don't really know what happens after that because the universe isn't old enought to have stars this small that have evolved out of their main sequence, for the sake of the game let's just assume that the helium core will get so big that the star will not be able to fuse hydrogen anymore and it will turn into a black dwarf.. probably..
After that, it all depends on the mass of the star,
here's the table of elements that a star can fuse ( see the last tables ).
As the star's core gets hotter it grows bigger, until it doesn't have enought mass to generate gravity to compress itself to electron degeberacy or it reaches a dense iron core, it's impossible to fuse iron while the star is "alive" because the only way fuse iron is to
use energy and all the other elements before iron
created energy instead.
Once a star reached either of these points it will "blow up" as a planetary nebula, supernova or the infamous balck hole, depending on it's mass:
Stars with [0.4, 8[ times the mass of the sun will turn into planetary nebula due to the fast gas and energy emissions that originate solar winds that leave the surrounding space rich with the elements that the star has fused, this will happen repeatidly originating nebulas like the cat's eye nebula, and a white dwarf will also be left behind, this white dwarf was the core the star, so it's probably made out of a shell burning hydrogen, a shell burning helium and a core with carbon and/or oxygen, this white dwarf will follow the steps described before.
Stars with [8, 20[ times the mass of the sun will collapse on themselfs because they can no longer produce energy to balance the gravity and so they can no longer achieve hydrostatic equilibrium; when the star was healthy, it pushed it's outer layer outward which balanced with the gravity that pushed all mass inward, but once it stops its production of energy, gravity gets the upper hand and pushes everything inward, this causes the layer to hit the dense core with such a speed that it will bounce back and it'll completely destroy the core in the process, just like when you throw a rock agains a wall, the rock bounces back and if you throw it with enough speed, the wall breaks ( or the rock does, either way you get the point )
What's left is just a nebula composed of all the elements that the star was made of, from hydrogen to uranium, iron is usually more present in this nebula due to the dense iron core that all stars which are this massive have. Iron marks the end of all stars, this has already been explained but uranium is created from fusing iron, this is possible because once the r-process occurres in the moment of the supernova, there's enough energy to fuse the iron and so we get uranium ash.
Sometime there might be an absence of hydrogen and helium in the nebula, this is because the star was so hot that it had completely burned all the hydrogen and helium it had, this happens in blue stars.
Stars with [20,+inf(or 150)[ times the mass of the sun will live the shortest, because their core is so hot that they burn through hydrogen in just a few thousands of years, once they stop producing energy, their mass will collapse on itself but since these stars are so massive they never really blow into supernovas but instead thire mass collapses into this point with infinite density that we call a black hole.
(I got all this from searching on the web, so please correct everything that might not be scientifically correct)
Now, with all that information, I can build a table of elements that a star creates through it's life time, the problem is to know how much of each element the star has in a given point in time.
All that's left is an algorithm that calculates the percentage of each element present in the core of a star knowing that every star stars with 70-75% hydrogen and 25-30% helium, and H + H + H + H = He; He + He + He = C; C + He = O; O + He = Ne; C + C = Mg; O + O = S, and I don't really know how the iron is formed. With all that information I think it's possible to create an equation that outputs how much of each element is present in the core of a star in a given time.