How to create a 38 Khz pulse with arduino using timer or PWM?

I could but it seems like they are very long numbers and I only need 40 or so distinct numbers. Also, I am trying to use an attiny so the library won't work. I'm not really trying to get you to do the work for me but I have a more reductionist approach to learning so having something to dismantle is immensely helpful.