\\ Run with gp -q -f erdos686.gp \\ Classify length-three consecutive-product ratios at square multipliers. solutions(N) = { my(T = thueinit(x^3-N, 1), hits = List(), D, a, b, q, g, X, Y); fordiv(N*(N^2-1), d, forstep(sign = -1, 1, 2, D = sign*d; foreach(thue(T, D), pair, [a,b] = pair; if(a <= 0 || b <= 0 || gcd(a,b) != 1, next); q = (a-N*b)/D; if(q <= 0 || denominator(q) != 1 || !issquare(q, &g), next); X = g*a; Y = g*b; if(X^3-X != N*(Y^3-Y), error("failed cubic reconstruction")); if(Y >= 2 && X >= Y+3, listput(hits, [X-2,Y-2])); ); ); ); return(Set(Vec(hits))); } for(s = 2, 25, print(s^2, " ", solutions(s^2))) quit