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.

This page as a plain text file.
%I A138009 #19 Jun 26 2025 07:58:42
%S A138009 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,
%T A138009 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,
%U A138009 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
%N A138009 a(n) = number of positive integers k, k <= n, where d(k) >= d(n); d(n) = number of positive divisors of n.
%H A138009 Robert Israel, <a href="/A138009/b138009.txt">Table of n, a(n) for n = 1..10000</a>
%F A138009 From _Amiram Eldar_, Jun 26 2025: (Start)
%F A138009 a(n) = n - 1 if and only if n is prime.
%F A138009 a(n) = 1 if and only if n is a highly composite number (A002182). (End)
%e A138009 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.
%p A138009 L:= [2]: A[1]:= 1:
%p A138009 for n from 2 to 100 do
%p A138009   v:= 2*numtheory:-tau(n);
%p A138009   k:= ListTools:-BinaryPlace(L,v-1);
%p A138009   A[n]:= n-k;
%p A138009   L:= [op(L[1..k]),v,op(L[k+1..-1])];
%p A138009 od:
%p A138009 seq(A[i],i=1..100); # _Robert Israel_, Sep 26 2018
%t A138009 Table[Length[Select[Range[n], Length[Divisors[ # ]]>=Length[Divisors[n]]&]], {n,1,100}] (* _Stefan Steinerberger_, Feb 29 2008 *)
%o A138009 (PARI) a(n) = my(dn=numdiv(n)); sum(k=1, n, numdiv(k) >= dn); \\ _Michel Marcus_, Sep 26 2018
%Y A138009 Cf. A000005, A002182, A067004, A079788.
%K A138009 nonn,look
%O A138009 1,3
%A A138009 _Leroy Quet_, Feb 27 2008
%E A138009 More terms from _Stefan Steinerberger_, Feb 29 2008