Determine the probability that for a positive base ten integer N drawn at random between 2 and 201 inclusively, the number N^{3} - 1 is expressible in the form p*q*r, where p, q and r are three distinct positive integers such that p, q and r (in this order) corresponds to three consecutive terms of an arithmetic progression.

I took the arithmetic sequence as q-d, q, q+d. Then N^3-1=(q-d)*q*(q+d) and d=sqrt(q^2-(N^3-1)/q)

q must be at least as large as N, otherwise the product would be too small because q+d could not be large enough to compensate for q and q-d less than N. Similarily, q must be less than N^1.5 because if it was larger then q*(q+d) would already exceed N.

Then I wrote a short UBASIC program which looped N=2 to 201, and for each N looped q from N to n^1.5:

10 for n=2 to 201

19 qmax=int(n^1.5)

20 q=n to qmax

30 if (n*n*n-1)@q<>0 then 70

40 x=q*q-(n*n*n-1)/q

41 d=isqrt(x)

50 if d*d=x then print n,q-d;q;q+d

70 next q

80 next n

Running this short program finds:

9 2 14 26

25 2 63 124

49 2 172 342

81 2 365 728

100 27 143 259

121 45 152 259

121 28 185 342

121 2 666 1330

169 2 1099 2196

196 117 211 305

There are 8 distinct values for N: 9,25,49,81,100,121,169,196 for a probability of 1/25. Continuing the program finds that not all N are perfect squares. N=273 is an answer with sequence 38, 527, 1016.