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.

A007862 Number of triangular numbers that divide n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also a(n) is the total number of ways to represent n+1 as a centered polygonal number of the form km(m+1)/2+1 for k>1. - Alexander Adamchuk, Apr 26 2007
Number of oblong numbers that divide 2n. - Ray Chandler, Jun 24 2008
The number of divisors d of 2n such that d+1 is also a divisor of 2n, see first formula. - Michel Marcus, Jun 18 2015
From Gus Wiseman, May 03 2019: (Start)
Also the number of integer partitions of n forming a finite arithmetic progression with offset 0, i.e. the differences are all equal (with the last part taken to be 0). The Heinz numbers of these partitions are given by A325327. For example, the a(1) = 1 through a(12) = 3 partitions are (A = 10, B = 11, C = 12):
1 2 3 4 5 6 7 8 9 A B C
21 42 63 4321 84
321 642
(End)

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.
G.f.: Sum_{k>=1} x^A000217(k)/(1-x^A000217(k)). - Jon Perry, Jul 03 2004
a(A130317(n)) = n and a(m) <> n for m < A130317(n). - Reinhard Zumkeller, May 23 2007
a(n) = A129308(2n). - Ray Chandler, Jun 24 2008
a(n) = Sum_{k=1..A000005(n)} A010054(A027750(n,k)). - Reinhard Zumkeller, Jul 05 2014
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