login
Number of representations of n as the difference of two positive triangular numbers.
16

%I #49 Aug 08 2024 07:31:12

%S 0,1,1,1,2,1,2,1,3,1,2,2,2,2,3,1,2,3,2,2,3,2,2,2,3,2,4,1,2,4,2,1,4,2,

%T 4,2,2,2,4,2,2,4,2,2,5,2,2,2,3,3,4,2,2,4,3,2,4,2,2,4,2,2,6,1,4,3,2,2,

%U 4,4,2,3,2,2,6,2,4,3,2,2,5,2,2,4,4,2,4,2,2,6,3,2,4,2,4,2,2,3,6,3,2,4,2,2,7

%N Number of representations of n as the difference of two positive triangular numbers.

%C a(n) is also the number of partitions of n into consecutive parts greater than 1. - _Omar E. Pol_, Feb 07 2022

%C a(n) is the number of solutions of the equations 2(x-1)y-(x-3)x=2(n+1) for 0<x<=y, x-values in A351284; y-values in A351285. Also the number of times n+1 appears in A351153. - _Stefano Spezia_, Feb 12 2022

%C Equivalence with _Stefano Spezia_ solutions: The equation 2(x-1)y-(x-3)x=2(n+1) can be rewritten (y+1-x/2)(x+1)=n; proof by solving both for y. So solutions factorize n, and since x+1 must be an integer and y+1-x/2 must be an integer, x must be even. So (x+1)|n means we are looking for odd divisors of n, which is the A001227 term of the Alekseyev formula. The correction by A010054 in the Alekseyev formula means: if n is a triangular number, the solution x=y+1 where x>y is not counted by Spezia. - _R. J. Mathar_, Feb 12 2022

%H Robert G. Wilson v, <a href="/A136107/b136107.txt">Table of n, a(n) for n = 1..54000</a>.

%H Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, <a href="http://arxiv.org/abs/2401.14346">arXiv:2401.14346</a>, <a href="https://www.youtube.com/watch?v=_EHAdf6izPI">Youtube</a>

%H Robert Dougherty-Bliss and Natalya Ter-Saakov, <a href="https://arxiv.org/abs/2408.03434">The Comma Sequence is Finite in Other Bases</a>, arXiv:2408.03434 [math.NT], 2024.

%F G.f.: Sum_{n>=1} x^((n^2+3*n)/2)/(1-x^n). - _Vladeta Jovovic_, May 13 2008

%F a(n) = A001227(n) - A010054(n). - _Max Alekseyev_, May 13 2009

%e a(2) = 1 because 3 - 1 = 2,

%e a(5) = 2 because 6 - 1 = 15 - 10 = 5,

%e a(9) = 3 because 10 - 1 = 15 - 6 = 45 - 36 = 9, etc.

%e For n = 21 the four partitions of 21 into consecutive parts are [21], [11, 10], [8, 7, 6] and [6, 5, 4, 3, 2, 1]. The last partition contains 1 as a part, hence there are only three partitions of 21 into consecutive parts whose parts are greater than 1, so a(21) = 3. - _Omar E. Pol_, Feb 07 2022

%t f[n_] := Block[{c = 0, k = 1}, While[k < n, If[ IntegerQ[ Sqrt[8 n + 4 k (k + 1) + 1]], c++ ]; k++ ]; c]; Table[f@n, {n, 105}]

%o (PARI) a(n) = numdiv(n>>valuation(n, 2)) - ispolygonal(n, 3); \\ _Michel Marcus_, Jan 08 2024

%Y Cf. A000217, A001227, A010054, A136108, A351153, A351284, A351285.

%K nonn

%O 1,5

%A _John W. Layman_ and _Robert G. Wilson v_, Dec 12 2007