Smartly mining

I can do the math and find Prime numbers and chains
but how to use that numbers in mining??