OFFSET
1,3
COMMENTS
a(n) <= n-1 if n > 1, because (n-1)*(n-2)/2 + n*(n-1)/2 = (n-1)^2.
a(7*k+2) <= k and a(7*k+6) <= k+2, because (7*k+2)*(7*k+1)/2 + k*(k-1)/2 = (5*k+1)^2 and (7*k+6)*(7*k+5)/2 + (k+2)*(k+1)/2 = (5*k+4)^2.
From Bernard Schott, Jun 27 2019: (Start)
a(m) = 1 iff the triangular number t(m-1) = (m-1)*m/2 is a square, so iff m-1 is in A001108, or m in A055997.
a(m) = 2 iff the triangular number t(m-1) + 1 is a square, so iff m-1 is in A006451. (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 4 because 4*3/2 + 5*4/2 = 4^2 and none of 1*0/2 + 5*4/2, 2*1/2 + 5*4/2, 3*2/2 + 5*4/2 are squares.
MAPLE
f:= proc(n) local k;
for k from 1 do
if issqr((k*(k-1)+n*(n-1))/2) then return k fi
od
end proc:
map(f, [$1..100]);
PROG
(PARI) a(n) = {my(k=1); while (!issquare(n*(n-1)/2 + k*(k-1)/2), k++); k; } \\ Michel Marcus, Jun 27 2019
CROSSREFS
KEYWORD
nonn,look
AUTHOR
J. M. Bergot and Robert Israel, Jun 05 2019
STATUS
approved