A136107 Number of representations of n as the difference of two positive triangular numbers.
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, 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, 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
Offset: 1
Keywords
Examples
a(2) = 1 because 3 - 1 = 2, a(5) = 2 because 6 - 1 = 15 - 10 = 5, a(9) = 3 because 10 - 1 = 15 - 6 = 45 - 36 = 9, etc. 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
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..54000.
- Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, arXiv:2401.14346, Youtube
- Robert Dougherty-Bliss and Natalya Ter-Saakov, The Comma Sequence is Finite in Other Bases, arXiv:2408.03434 [math.NT], 2024.
Programs
-
Mathematica
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}]
-
PARI
a(n) = numdiv(n>>valuation(n, 2)) - ispolygonal(n, 3); \\ Michel Marcus, Jan 08 2024
Formula
G.f.: Sum_{n>=1} x^((n^2+3*n)/2)/(1-x^n). - Vladeta Jovovic, May 13 2008
Comments