cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A082183 Smallest k > 0 such that T(n) + T(k) = T(m), for some m, T(i) being the triangular numbers, n > 1.

This page as a plain text file.
%I A082183 #50 Apr 24 2021 03:49:23
%S A082183 2,5,9,3,5,27,10,4,8,14,17,9,5,21,135,12,14,35,6,9,17,30,12,18,10,7,
%T A082183 54,21,23,495,42,14,26,8,49,27,15,20,98,30,32,80,9,19,35,62,45,17,20,
%U A082183 14,99,39,10,18,54,24,44,78,81,45,25,85,153,11,50,125,20,29,53,94,97
%N A082183 Smallest k > 0 such that T(n) + T(k) = T(m), for some m, T(i) being the triangular numbers, n > 1.
%C A082183 For 16 years this entry stood with no upper bound, and indeed with no proof that a(n) always existed. In February 2020 the following three bounds and formulas arrived. They are listed in chronological order.  Here k = k(n) denotes the smallest number such that T(n)+T(k) is a triangular number T(m) for some m = m(n). - _N. J. A. Sloane_, Feb 22 2020
%C A082183 k = T(n) - 1 is an upper bound on k(n) = a(n). For T(k) makes a huge triangle; all the elements of the T(n) triangle can be thinly plated onto the side of the big one as a single additional row, producing T(k+1) with m = k+1. - _Allan C. Wechsler_, Feb 19 2020
%C A082183 Let Q be the largest odd number < n dividing T(n). Then T(n) is the sum of Q consecutive integers, the last Q rows of the triangle T(m) with m = T(n)/Q + (Q-1)/2, giving the upper bound k <= T(n)/Q - (Q+1)/2. [This bound is now A332554, the values of Q are in A332547.] This bound is not tight: for n=9 it gives a(9) <= 6 when in fact a(9) = 4. - _Michael J. Collins_, Feb 19 2020
%C A082183 Comments from Richard C. Schroeppel, Feb 19 2020: (Start)
%C A082183 2T(n) = 2T(m) - 2T(k) = m^2 + m - k^2 - k = (m-k) (m + k + 1). Now (m-k) and (m+k+1) are of opposite parity. Factor 2T(n) into the product of an odd number times an even number. We can take one of these to be m-k, and the other to be m+k+1.
%C A082183 The factorization 2T(n) = n^2 + n gives two obvious solutions, n * (n+1) and 1 * (n^2+n). Equating these to (m-k) * (m+k+1) gives the two "trivial" solutions k=0, m=n and k=T(n)-1, m=T(n).
%C A082183 Unless n is a Mersenne prime, or n+1 is a Fermat prime [these are the n such that Q=1, see A068194] there will be a nontrivial odd divisor of n(n+1) other than 1, n, or n+1. Select the odd divisor d logarithmicly closest to n + 1/2 that isn't n or n+1.
%C A082183 Let q be the quotient n(n+1)/q. Then m-k = min(d,q) and m+k+1 = max(d,q). Solve for k, which is the required minimum k(n) = a(n).
%C A082183 Example:  n=5, T(n)=15, 2T(n)=30 = 3*10, d=3, q=10, k=3, m=6, 15+6 = 21. (End)
%H A082183 Chai Wah Wu, <a href="/A082183/b082183.txt">Table of n, a(n) for n = 2..10000</a>
%H A082183 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.
%p A082183 f:= proc(n) local e,t,te;
%p A082183      t:= n*(n+1);
%p A082183      e:= padic:-ordp(t,2);
%p A082183      te:= 2^e;
%p A082183      min(map(d -> (abs(te*d-t/(te*d))-1)/2, numtheory:-divisors(t/te)) minus {0}):
%p A082183 map(f, [$2..100]); # _Robert Israel_, Sep 15 2017
%t A082183 Table[SelectFirst[Range[10^3], Function[m, PolygonalNumber@ Floor@ Sqrt[2 m] == m][PolygonalNumber[n] + PolygonalNumber[#]] &], {n, 2, 72}] (* _Michael De Vlieger_, Sep 19 2017, after Maple by _Robert Israel_ *)
%o A082183 (PARI) for(n=2, 100, t=n*(n+1)/2; for(k=1, 10^9, u=t+k*(k+1)/2; v=floor(sqrt(2*u)); if(v*(v+1)/2==u, print1(k", "); break)))
%o A082183 (Python)
%o A082183 from __future__ import division
%o A082183 from sympy import divisors
%o A082183 def A082183(n):
%o A082183     t = n*(n+1)
%o A082183     ds = divisors(t)
%o A082183     for i in range(len(ds)//2-2,-1,-1):
%o A082183         x = ds[i]
%o A082183         y = t//x
%o A082183         a, b = divmod(y-x,2)
%o A082183         if b:
%o A082183             return a
%o A082183     return -1 # _Chai Wah Wu_, Sep 12 2017
%Y A082183 Cf. A000217, A072522, values of m are in A082184, A332547.
%Y A082183 A332554 is an upper bound on a(n).
%Y A082183 See A055527 for a very similar sequence involving Pythagorean triples. - _Bradley Klee_, Feb 20 2020
%Y A082183 See also A309332 (number of ways to write a triangular number as a sum of two triangular numbers), A309507 (... as a difference ...).
%K A082183 nonn
%O A082183 2,1
%A A082183 _Ralf Stephan_, Apr 06 2003
%E A082183 Entry updated by _N. J. A. Sloane_, Feb 22 2020