Pins and Resistor

think that it is 38 Khz,

I can't see you using any modulation at all in this sketch.

All I can see is you doing this:-
digitalWrite(IRpin, st)
when st is not defined the first time round the loop
then:-
while (micros() - j < times - times[i-1]) {}
which does nothing, just a delay for a number of micro seconds defined by the array.
then:-
if (st == LOW && i != 1) st = HIGH; else st = LOW;
Which toggles st all except the first time round the loop and sets st for the first time.
So where do you think the 38KHz comes in and do you know it is 38KHz anyway?

So it's not a matter of correcting the code but writing it.
Look at the code here:-
Building a Universal Remote with an Arduino