OFFSET
0,2
COMMENTS
Equivalently, if d is the common difference of the arithmetic progression (x, y, z), then a(n) is the smallest integer m such that the Diophantine equation y * (4d-y) = m with y>0, d>0 and y-d >0 has exactly n solutions (see A334566).
This sequence is not increasing: a(2) = 27 > a(3) = 15.
LINKS
Project Euler, Problem 135: Same differences
Euler project, Problem 136: Singleton difference
EXAMPLE
a(4) = 63 because 11^2-7^2-3^2 = 13^2-9^2-5^2 = 27^2-21^2-15^2 = 79^2-63^2-47^2 = 63 and there is no term m < 63 in the context such that z^2 - y^2 - x^2 = m has 4 solutions.
MAPLE
g:= proc(y, m) local d;
d:= m/(4*y)+y/4;
d::posint and y > d
end proc:
f:= proc(m) local L;
nops(select(g, numtheory:-divisors(m), m));
end proc:
V:= Array(0..50): count:= 0:
for x from 1 while count < 51 do
v:= f(x);
if v <= 50 and V[v] = 0 then V[v]:= x; count:= count+1;
fi
od:
convert(V, list); # Robert Israel, May 19 2020
MATHEMATICA
ok[n_, x_] := Block[{d = (x + n/x)/4}, IntegerQ[d] && x > d]; t = Table[ Length@ Select[ Divisors[n], ok[n, #] &], {n, 21000}]; k=0; Reap[ While[ (v = Position[ t, k++]) != {}, Sow[v[[1, 1]]]]][[2, 1]] (* Giovanni Resta, May 19 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bernard Schott, May 19 2020
EXTENSIONS
More terms from Giovanni Resta, May 19 2020
STATUS
approved