Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #4 Dec 23 2018 03:45:56
%S 1,2,3,1,5,2,7,1,9,4,2,5,1,3,15,7,2,8,1,5,3,10,6,2,4,1,27,13,3,14,31,
%T 2,6,1,10,17,7,3,5,19,2,20,1,4,9,22,14,3,7,5,2,25,1,8,4,6,12,28,3,29,
%U 13,2,63,1,14,32,4,8,6,34,3,35,16,2,5,1,17,38,13,4,18,40,6,3,19,11,2,43,1
%N Values of j corresponding to least possible k>0 with T(k)-T(j)=n, where T(i)>0 are the triangular numbers A000217.
%C For k see A138796, for T(k) see A138797 and for T(j) see A138799.
%C The number of ways n can be written as difference of two triangular numbers is sequence A136107
%e a(30)=3 because 30 = T(30)-T(29)=T(11)-T(8)=T(9)-T(5)=T(8)-T(3) and 3 is the least index of the subtrahends.
%t T=#(#+1)/2&;Sort[{k,j}/.{ToRules[Reduce[{T[k]-T[j]\[Equal]#,0<j<k},{j,k},Integers]]}][[1,2]]&/@Range[2,100]
%Y Cf. A000217, A109814, A118235, A136107, A138796, A138797, A138799.
%K nonn
%O 2,2
%A Peter Pein (petsie(AT)dordos.net), Mar 30 2008