Assume linear initially, so t=as+b where a and b have to be found. 12=4a+b; 23=8a+b. Subtract first equation from second: 11=4a so a=11/4 and b=1. Now test: 12*11/4+1=34 (using input 12). This doesn't work, because the third output should be 40, not 34.
Now try quadratic: t=as^2+bs+c: 12=16a+4b+c; 23=64a+8b+c; 40=144a+12b+c. Call these equations in order A, B, C. B-A: 11=48a+4b; C-B: 17=80a+4b. Call these two equations D and E. E-D: 6=32a, so a=6/32=3/16, and 4b=11-48*3/16=11-9=2, b=2/4=1/2. So c=12-3-2=7 and t=3s^2/16+s/2+7. This equation satisfies the first three pairs of numbers (s,t). Put s=23: t=3*23^2/16+23/2+7=3*529/16+23/2+7=1587/16+23/2+7=117.6875; put s=31: t=202.6875.
(If these answers are incorrect, then it's because there is insufficient information in the question to derive an alternative solution.)