%I #55 Dec 08 2023 12:30:01
%S 0,1,1,1,3,3,1,2,5,3,3,3,3,7,3,1,5,5,3,7,7,3,3,5,5,7,7,3,7,7,1,3,7,7,
%T 11,5,3,7,7,3,7,7,3,11,11,3,3,5,8,11,7,3,7,15,7,7,7,3,7,7,3,11,5,3,15,
%U 7,3,7,15,7,5,5,3,11,11,7,15,7,3,9,9,3,7
%N Number of ways the n-th triangular number T(n) = A000217(n) can be written as the difference of two positive triangular numbers.
%C Equivalently, a(n) is the number of triples [n,k,m] with k>0 satisfying the Diophantine equation n*(n+1) + k*(k+1) - m*(m+1) = 0. Any such triple satisfies a triangle inequality, n+k > m. The n for which there is a triple [n,n,m] are listed in A053141. - _Bradley Klee_, Mar 01 2020; edited by _N. J. A. Sloane_, Mar 31 2020
%H Alois P. Heinz, <a href="/A309507/b309507.txt">Table of n, a(n) for n = 1..20000</a>
%H J. S. Myers, R. Schroeppel, S. R. Shannon, N. J. A. Sloane, and P. Zimmermann, <a href="http://arxiv.org/abs/2004.14000">Three Cousins of Recaman's Sequence</a>, arXiv:2004:14000 [math.NT], April 2020.
%H M. A. Nyblom, <a href="http://www.fq.math.ca/Scanned/39-3/nyblom.pdf">On the representation of the integers as a difference of nonconsecutive triangular numbers</a>, Fibonacci Quarterly 39:3 (2001), pp. 256-263.
%F a(n) = 1 <=> n in { A068194 } \ { 1 }.
%F a(n) is even <=> n in { A001108 } \ { 0 }.
%F a(n) = number of odd divisors of n*(n+1) (or, equally, of T(n)) that are greater than 1. - _N. J. A. Sloane_, Apr 03 2020
%F a(n) = A092517(n) - A063440(n) - 1. - _Ridouane Oudra_, Dec 08 2023
%e a(5) = 3: T(5) = T(6)-T(3) = T(8)-T(6) = T(15)-T(14).
%e a(7) = 1: T(7) = T(28)-T(27).
%e a(8) = 2: T(8) = T(13)-T(10) = T(36)-T(35).
%e a(9) = 5: T(9) = T(10)-T(4) = T(11)-T(6) = T(16)-T(13) = T(23)-T(21) = T(45)-T(44).
%e a(49) = 8: T(49) = T(52)-T(17) = T(61)-T(36) = T(94)-T(80) = T(127)-T(117) = T(178)-T(171) = T(247)-T(242) = T(613)-T(611) = T(1225)-T(1224).
%e The triples with n <= 16 are:
%e 2, 2, 3
%e 3, 5, 6
%e 4, 9, 10
%e 5, 3, 6
%e 5, 6, 8
%e 5, 14, 15
%e 6, 5, 8
%e 6, 9, 11
%e 6, 20, 21
%e 7, 27, 28
%e 8, 10, 13
%e 8, 35, 36
%e 9, 4, 10
%e 9, 6, 11
%e 9, 13, 16
%e 9, 21, 23
%e 9, 44, 45
%e 10, 8, 13
%e 10, 26, 28
%e 10, 54, 55
%e 11, 14, 18
%e 11, 20, 23
%e 11, 65, 66
%e 12, 17, 21
%e 12, 24, 27
%e 12, 77, 78
%e 13, 9, 16
%e 13, 44, 46
%e 13, 90, 91
%e 14, 5, 15
%e 14, 11, 18
%e 14, 14, 20
%e 14, 18, 23
%e 14, 33, 36
%e 14, 51, 53
%e 14, 104, 105
%e 15, 21, 26
%e 15, 38, 41
%e 15, 119, 120
%e 16, 135, 136. - _N. J. A. Sloane_, Mar 31 2020
%p with(numtheory): seq(tau(n*(n+1))-tau(n*(n+1)/2)-1, n=1..80); # _Ridouane Oudra_, Dec 08 2023
%t TriTriples[TNn_] := Sort[Select[{TNn, (TNn + TNn^2 - # - #^2)/(2 #),
%t (TNn + TNn^2 - # + #^2)/(2 #)} & /@
%t Complement[Divisors[TNn (TNn + 1)], {TNn}],
%t And[And @@ (IntegerQ /@ #), And @@ (# > 0 & /@ #)] &]]
%t Length[TriTriples[#]] & /@ Range[100]
%t (* _Bradley Klee_, Mar 01 2020 *)
%Y Cf. A000217, A001108, A046079 (the same for squares), A068194, A100821 (the same for primes for n>1), A309332.
%Y See also A053141. The monotonic triples [n,k,m] with n <= k <= m are counted in A333529.
%Y Cf. A092517, A063440.
%K nonn
%O 1,5
%A _Alois P. Heinz_, Aug 05 2019