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.

A140635 Smallest positive integer having the same number of divisors as n.

This page as a plain text file.
%I A140635 #19 Aug 31 2023 12:16:03
%S A140635 1,2,2,4,2,6,2,6,4,6,2,12,2,6,6,16,2,12,2,12,6,6,2,24,4,6,6,12,2,24,2,
%T A140635 12,6,6,6,36,2,6,6,24,2,24,2,12,12,6,2,48,4,12,6,12,2,24,6,24,6,6,2,
%U A140635 60,2,6,12,64,6,24,2,12,6,24,2,60,2,6,12,12,6,24,2,48,16,6,2,60,6,6,6,24,2
%N A140635 Smallest positive integer having the same number of divisors as n.
%C A140635 a(n) <= n for all n. Moreover, a(n) = n if and only if n belongs to A005179 or A007416.
%H A140635 Antti Karttunen, <a href="/A140635/b140635.txt">Table of n, a(n) for n = 1..10000</a>
%F A140635 a(n) = A005179(A000005(n)).
%t A140635 a140635[n_] := NestWhile[#+1&, 1, DivisorSigma[0, n]!=DivisorSigma[0, #]&]
%t A140635 a140635[{m_, n_}] := Map[a140635, Range[m, n]]
%t A140635 a140635[{1, 89}] (* _Hartmut F. W. Hoft_, Jun 13 2023 *)
%o A140635 (PARI) A140635(n) = { my(nd = numdiv(n)); for (i=1, n, if (numdiv(i) == nd, return (i))); }; \\ After A139770, _Antti Karttunen_, May 27 2017
%o A140635 (Python)
%o A140635 from sympy import divisor_count as d
%o A140635 def a(n):
%o A140635     x=d(n)
%o A140635     m=1
%o A140635     while True:
%o A140635         if d(m)==x: return m
%o A140635         else: m+=1 # _Indranil Ghosh_, May 27 2017
%Y A140635 Cf. A000005, A005179, A007416, A139770.
%Y A140635 Cf. A019505, A138113, A061300 (sequences that can be defined in terms of this sequence).
%K A140635 nonn
%O A140635 1,2
%A A140635 _Max Alekseyev_, May 19 2008