The power dissipation in the voltage setting resistors is but a tiny fraction of what will be dissipated in the LM317. R1 MUST be a fixed resistor, from 100 to 220Ω. The dissipation is higher at 100Ω, than it would be at 220Ω. If using 220Ω, P(R1) = E²/R1 = 1.25²/220 = 7mW.
To get ~24V out, R2 (the 5K pot) will have to be set to 4200Ω, so the power dissipated in it will be P(R2) = E²/R2 = (24-1.25)²/4200 = 123mW, so a 1/2W Pot will be fine.
What current will your load draw? Your biggest problem will be heatsinking the LM317. If your load is 1A, you will need a heatsink capable of dissipating I*E = 1* (28.5-24) = 4.5W, which will need several tens of square cm of heatsink.