login
A386849
For n >= 0, a(n) is the least t >= 1 such that n^2 + 8*t is a square (A000290) where t is a triangular number (A000217) or a(n) = -1 if no such t exists.
1
-1, 1, -1, -1, 6, 3, 36, 15, 10, 45, 28, 6, 630, 15, 36, 378, 66, 55, 3240, 10, 78, 36, 120, 105, 378, 153, 28, 45, 190, 15, 25200, 231, 210, 9180, 36, 78, 990, 105, 300, 630, 378, 21, 97020, 45, 406, 153, 496, 465, 3240, 78, 300, 171, 630, 55, 2016, 28, 120, 1485
OFFSET
0,5
COMMENTS
The two solutions of the Diophantine equation x^2 + n*x - 2*t = 0 are x_1 = ( - n + sqrt(n^2 + 8*t)) / 2 and x_2 = ( - n - sqrt(n^2 + 8*t)) / 2.
a(n) <= n^4/32 - n^2/8, with equality if n is in A014574. - Robert Israel, Sep 21 2025
LINKS
Ctibor O. Zizka, Plot of n vs. a(n)
FORMULA
It appears that a(2*n+3) = A000217(A082183(n+1)). - Michel Marcus, Sep 22 2025
EXAMPLE
For n = 4, the least triangular number t >= 1 such that (16 + 8*t) is a square is t = 6, thus a(4) = 6.
MAPLE
f:= proc(n) local s, S, q;
q:= n^2-1;
S:= select(t -> t - q/t mod 4 = 2, numtheory:-divisors(q));
S:= select (`>=`, map(s -> (s-q/s)/4-1/2, S), 1);
if S = {} then return -1 fi;
s:= min(S);
s*(s+1)/2
end proc:
f(1):= 1:
map(f, [$0..100]); # Robert Israel, Sep 21 2025
MATHEMATICA
a[n_] := Module[{k = 1, t = 1}, While[! IntegerQ[Sqrt[n^2 + 8*t]], k++; t += k]; t]; a[0] = a[2] = a[3] = -1; Array[a, 100, 0] (* Amiram Eldar, Sep 21 2025 *)
PROG
(PARI) a(n) = if ((n==0) || (n==2) || (n==3), -1, my(k=1); while (!issquare(n^2+4*k*(k+1)), k++); t=k*(k+1)/2); \\ Michel Marcus, Sep 21 2025
CROSSREFS
KEYWORD
sign,look
AUTHOR
Ctibor O. Zizka, Sep 20 2025
STATUS
approved