Reptisun 10.0 t5 HO or Arcadia 12% t5 at 12" from basking spot. Length for a 40 gal should be a 22" bulb and fixture. Usually you want to cover 1/2 of the enclosure, but they don't make a 18" bulb. Wattage for a Reptisun 10.0 22" is 24 watts
As for a basking bulb, a PAR38 halogen from a hardware/home improvement store works great. You need whatever wattage will get your basking spot to 100-105. I suggest a dimmable fixture as this allows you to fine-tune the temps without moving the basking spot around.