I made a calculator based on Ammako math and it worked for me. Im sharing it here
Usage:
Make a copy of it so you can edit it
Fill the light green boxes with your trainer id and secret trainer id
Select an empty cell and press delete, it will generate a random ultra shint pokemon id each time
Remember to turn off the shiny flag in PkHex and then enter the result pokemon id