%I #31 Mar 10 2014 08:39:52
%S 0,1,10,10,55,-1,210,120,120,1485,2145,-1,2080,-1,-1,56616,1326,12561,
%T -1,1540,1540,21736,-1,-1,52650,16653,4950,26796,10440,12880,7750,-1,
%U -1,7140,7140,154290,-1,11476,-1,214840,-1,-1,207690,23252790,-1,-1,6895041,-1,750925
%N Least triangular number representable as a sum of n consecutive triangular numbers, or -1 if no such triangular number exists.
%e a(5) = 55 because 55 is the least triangular number representable as a sum of five consecutive triangular numbers: 55 = 3 + 6 + 10 + 15 + 21.
%e a(7) = 210 because 210 is the least triangular number representable as a sum of seven consecutive triangular numbers: 210 = 10 + 15 + 21 + 28 + 36 + 45 + 55.
%e 10 appears twice because 10 = 1 + 3 + 6 and 10 = 0 + 1 + 3 + 6.
%t a[1] = 0; a[n_] := Block[{t, x, y, s = Reduce[n*(-1+3*t^2+3*t*n+n^2)/6 == x*(x+1)/2 && x>0 && t >= 0, {t, x}, Integers]}, If[s === False, -1, y = Min[x /. List @ ToRules @ Expand[s /. C[1] -> 1]]; y*(y+1)/2]]; Array[a, 49] (* _Giovanni Resta_, Mar 02 2014 *)
%Y Cf. A000217, A129803, A131557, A238018.
%K sign
%O 1,3
%A _Alex Ratushnyak_, Feb 17 2014
%E a(6) and a(12)-a(49) from _Jon E. Schoenfield_ and _Giovanni Resta_, Mar 04 2014