p = 4*a(1) m = 2.0 define v(x) { if(x<0) return(-x) else return(x) } t = 2 for(n=1; n<999999999999; n++){ y = sqrt(n)*p; x = v(s(p*e(y))); if(x<m){ m=x; print n, " ", m, "\n"; } if(n>=t){ t = t*2; print "reached ", n, "\n"; } } is a bc program which tries to compute the sequence 1, 2, 6, 17, 22, 25, 37, 58, 163, ... aka http://oeis.org/A069014 (You need to preset scale=something large before running it). This is very slow. Presumably, the next entry in the sequence is of order n=10^12 and would require computing the fractional part of a number having about 10^6 digits before the decimal point. This seems infeasible to reach unless way smarter algorithms can be invented. -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)