A007862 Number of triangular numbers that divide n.
1, 1, 2, 1, 1, 3, 1, 1, 2, 2, 1, 3, 1, 1, 3, 1, 1, 3, 1, 2, 3, 1, 1, 3, 1, 1, 2, 2, 1, 5, 1, 1, 2, 1, 1, 4, 1, 1, 2, 2, 1, 4, 1, 1, 4, 1, 1, 3, 1, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 5, 1, 1, 3, 1, 1, 4, 1, 1, 2, 2, 1, 4, 1, 1, 3, 1, 1, 4, 1, 2, 2, 1, 1, 5, 1, 1, 2, 1, 1, 6, 2, 1, 2, 1, 1, 3, 1, 1, 2, 2, 1, 3, 1, 1, 5
Offset: 1
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Centered Polygonal Number.
- Wikipedia, Arithmetic progression.
- Gus Wiseman, Sequences counting and ranking integer partitions by the differences of their successive parts.
Crossrefs
Programs
-
Haskell
a007862 = sum . map a010054 . a027750_row -- Reinhard Zumkeller, Jul 05 2014
-
Mathematica
sup=90; TriN=Array[ (#+1)(#+2)/2&, Floor[ N[ Sqrt[ sup*2 ] ] ]-1 ]; Array[ Function[n, 1+Count[ Map[ Mod[ n, # ]&, TriN ], 0 ] ], sup ] Table[Count[Divisors[k], ?(IntegerQ[Sqrt[8 # + 1]] &)], {k, 105}] (* _Jayanta Basu, Aug 12 2013 *) Table[Length[Select[IntegerPartitions[n],SameQ@@Differences[Append[#,0]]&]],{n,0,30}] (* Gus Wiseman, May 03 2019 *)
-
PARI
a(n) = sumdiv(n, d, ispolygonal(d, 3)); \\ Michel Marcus, Jun 18 2015
-
Python
from itertools import pairwise from sympy import divisors def A007862(n): return sum(1 for a, b in pairwise(divisors(n<<1)) if a+1==b) # Chai Wah Wu, Jun 09 2025
Formula
a(n) = Sum_{d|2*n,d+1|2*n} 1.
a(n) = A129308(2n). - Ray Chandler, Jun 24 2008
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Dec 31 2023
Extensions
Extended by Ray Chandler, Jun 24 2008
Comments