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.

A138009 a(n) = number of positive integers k, k <= n, where d(k) >= d(n); d(n) = number of positive divisors of n.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 2, 4, 3, 10, 1, 12, 5, 6, 2, 16, 2, 18, 3, 10, 11, 22, 1, 15, 13, 14, 5, 28, 2, 30, 7, 18, 19, 20, 1, 36, 22, 23, 4, 40, 5, 42, 11, 12, 28, 46, 1, 33, 14, 31, 15, 52, 7, 34, 8, 36, 37, 58, 1, 60, 39, 19, 10, 42, 10, 66, 22, 45, 11, 70, 2, 72, 48, 25, 26, 51, 13, 78, 4
Offset: 1

Views

Author

Leroy Quet, Feb 27 2008

Keywords

Examples

			9 has 3 positive divisors. Among the first 9 positive integers, there are four that have more than or equal the number of divisors than 9 has: 4, with 3 divisors; 6, with 4 divisors; 8, with 4 divisors; and 9, with 3 divisors. So a(9) = 4.
		

Crossrefs

Programs

  • Maple
    L:= [2]: A[1]:= 1:
    for n from 2 to 100 do
      v:= 2*numtheory:-tau(n);
      k:= ListTools:-BinaryPlace(L,v-1);
      A[n]:= n-k;
      L:= [op(L[1..k]),v,op(L[k+1..-1])];
    od:
    seq(A[i],i=1..100); # Robert Israel, Sep 26 2018
  • Mathematica
    Table[Length[Select[Range[n], Length[Divisors[ # ]]>=Length[Divisors[n]]&]], {n,1,100}] (* Stefan Steinerberger, Feb 29 2008 *)
  • PARI
    a(n) = my(dn=numdiv(n)); sum(k=1, n, numdiv(k) >= dn); \\ Michel Marcus, Sep 26 2018

Formula

From Amiram Eldar, Jun 26 2025: (Start)
a(n) = n - 1 if and only if n is prime.
a(n) = 1 if and only if n is a highly composite number (A002182). (End)

Extensions

More terms from Stefan Steinerberger, Feb 29 2008