OFFSET
1,5
EXAMPLE
a(5) = 2 because 2 is the least integer such that the sum of 5 consecutive triangular numbers starting with triangular(2) is a triangular number: 55 = 3+6+10+15+21.
a(7) = 4 because 4 is the least integer such that the sum of 7 consecutive triangular numbers starting with triangular(4) is a triangular number: 210 = 10+15+21+28+36+45+55.
MATHEMATICA
s[n_, k_] := n*(3*k^2 + 3*k*n + n^2 - 1)/6; a[1] = 0; a[n_] := Module[{r}, r = Reduce[ k >= 0 && m >= 0 && 8*s[n, k] + 1 == m^2 , {k, m}, Integers] /. C[1] -> 1 // FullSimplify; If[r === False, -1, k /. {ToRules[r]} // Min]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Feb 26 2014 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Alex Ratushnyak, Feb 17 2014
EXTENSIONS
More terms from Jean-François Alcover, Feb 26 2014
STATUS
approved