A366979 Number of divisors of n less than or equal to d(n).
1, 2, 1, 2, 1, 3, 1, 3, 2, 2, 1, 5, 1, 2, 2, 3, 1, 4, 1, 4, 2, 2, 1, 6, 1, 2, 2, 3, 1, 5, 1, 3, 2, 2, 1, 6, 1, 2, 2, 5, 1, 5, 1, 3, 3, 2, 1, 6, 1, 3, 2, 3, 1, 4, 1, 5, 2, 2, 1, 8, 1, 2, 2, 3, 1, 4, 1, 3, 2, 4, 1, 8, 1, 2, 3, 3, 1, 4, 1, 6, 2, 2, 1, 7, 1, 2, 2, 4, 1, 7
Offset: 1
Examples
a(8) = 3; There are 3 divisors of 8 that are <= d(8) = 4. They are: {1,2,4}. a(25) = 1; 1 is the only divisor of 25 that is <= d(25) = 3.
Programs
-
Mathematica
Table[1 + Sum[Sum[(Sign[Floor[i/k]] - Sign[Floor[(i - 1)/k]]), {i, 2, DivisorSigma[0, n]}] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
-
PARI
a(n) = my(nd=numdiv(n)); sumdiv(n, d, d <= nd); \\ Michel Marcus, Oct 30 2023
Formula
a(n) = Sum_{d|n, d <= d(n)} 1.
a(n) = 1 + Sum_{d|n} (Sum_{i=2..d(n)} ( sign(floor(i/d)) - sign(floor((i-1)/d)) )), where d(n) is the number of divisors of n (A000005).
Comments