Resistor values for adjustable voltage regulator
Turn the problem around: Once you know R1, then R2 is easy to solve for. R1 is pretty easy to decide upon. 

It is a bit of a balancing act, really, but here's how it goes:


The datasheet suggests R1 be kept below 400 kOhms for stability. Lower the value of R1, higher the quiescent current required by the voltage splitter R1+R2. Higher the value of R1, higher the instability of the output. 
We know that the upper leg of R1 in the diagram is biased at 3.75 Volts for steady state. 
Hence, let us start with the maximum standard E12 series resistor value for R1 within the datasheet constraints, i.e. 390 KOhms
IR1 can be calculated thus: I = V / R = 3.75 / 390,000 = 9.61538 uA
Current through R2 is given as the sum of current through R1, and bias current 150 nA. IR2 is thus 9.61538 - 0.15 = 9.46538 nA
For a desired output voltage of 4.0 Volts, R2 must thus develop 4.0 - 3.75 = 0.25 Volts for the above current.
Therefore R2 = 0.25 / 9.46538e-6 = 26412 Ohms. Closest E12 value = 27 kOhms.
Vo with R1 = 390 k and R2 = 27 k is 4.01367 Volts, less than 0.5% deviation from target voltage (assuming perfect resistor values, of course).


If stability is more desirable than saving quiescent current, try the above sequence with a starting value of R1 as 22 kOhms.


IR1 = 170.455 uA
IR2 = 170.305 uA
R2 = 1468 Ohms, nearest E12 value 1.5 kOhms
Vo = 4.00591 Volts.


Using the above calculation steps, choose any value for R1 as long as it is less than 400 kOhms, to obtain the value of R2.