A129308 a(n) is the number of positive integers k such that k*(k+1) divides n.
0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 3, 0, 1, 0, 2, 0, 3, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 2, 0, 1, 0, 5, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 4, 0, 1, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 1, 0, 1, 0, 4, 0, 1, 0, 1, 0, 3, 0, 1, 0, 2, 0, 2, 0, 1, 0
Offset: 1
Keywords
Examples
The divisors of 20 are 1,2,4,5,10,20. Of these there are two that are of the form k(k+1): 2 = 1*2 and 20 = 4*5. So a(2) = 2.
Links
- Ray Chandler, Table of n, a(n) for n = 1..10000
- P. Erdős and R. R. Hall, On some unconventional problems on the divisors of integers, J. Austral. Math. Soc., Ser. A, 25, 479-485 (1978).
- MathOverflow, On the number of consecutive divisors of an integer.
Crossrefs
Programs
-
Mathematica
a = {}; For[n = 1, n < 90, n++, k = 1; co = 0; While[k < Sqrt[n], If[IntegerQ[ n/(k*(k + 1))], co++ ]; k++ ]; AppendTo[a, co]]; a (* Stefan Steinerberger, May 27 2007 *) Table[Count[Differences[Divisors[n]],1],{n,30}] (* Gus Wiseman, Oct 15 2019 *)
-
PARI
a(n)=sumdiv(n, d, n%(d+1)==0); \\ Michel Marcus, Jan 06 2015
-
Python
from itertools import pairwise from sympy import divisors def A129308(n): return 0 if n&1 else sum(1 for a, b in pairwise(divisors(n)) if a+1==b) # Chai Wah Wu, Jun 09 2025
Formula
a(2n-1) = 0; a(2n) = A007862(n). - Ray Chandler, Jun 24 2008
G.f.: Sum_{n>=1} x^(n*(n+1))/(1-x^(n*(n+1))). - Joerg Arndt, Jan 30 2011 [modified by Ilya Gutkovskiy, Apr 14 2021]
a(n) = A000005(n) - A137921(n), where A137921(n) is the number of maximal runs of successive divisors of n. - Gus Wiseman, Oct 15 2019
a(n) = Sum_{d|n} A005369(d). - Ridouane Oudra, Jan 22 2021
a(n) = A195155(n)-1. - Antti Karttunen, Feb 21 2023
From Amiram Eldar, Dec 31 2023: (Start)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1. (End)
Extensions
More terms from Stefan Steinerberger, May 27 2007
Extended by Ray Chandler, Jun 24 2008
Comments