login
Numbers with 4 divisors.
40

%I #87 Aug 16 2024 20:47:41

%S 6,8,10,14,15,21,22,26,27,33,34,35,38,39,46,51,55,57,58,62,65,69,74,

%T 77,82,85,86,87,91,93,94,95,106,111,115,118,119,122,123,125,129,133,

%U 134,141,142,143,145,146,155,158,159,161,166,177,178,183,185,187

%N Numbers with 4 divisors.

%C Essentially the same as A007422.

%C Numbers which are either the product of two distinct primes (A006881) or the cube of a prime (A030078).

%C 4*a(n) are the solutions to A048272(x) = Sum_{d|x} (-1)^d = 4. - _Benoit Cloitre_, Apr 14 2002

%C Since A119479(4)=3, there are never more than 3 consecutive integers in the sequence. Triples of consecutive integers start at 33, 85, 93, 141, 201, ... (A039833). No such triple contains a term of the form p^3. - _Ivan Neretin_, Feb 08 2016

%C Numbers that are equal to the product of their proper divisors (A007956) (proof in Sierpiński). - _Bernard Schott_, Apr 04 2022

%D Wacław Sierpiński, Elementary Theory of Numbers, Ex. 2 p. 174, Warsaw, 1964.

%H R. J. Mathar, <a href="/A030513/b030513.txt">Table of n, a(n) for n = 1..1000</a>

%H R. J. Mathar, <a href="/A030513/a030513.mp.txt">Maple programs for A030638, A030637, A030636, A030635, A030634, A030633, A030632, A030631, A030630, A030629, A030628, A030627, A030626, A030516, A030515, A030514, A030513</a>

%F {n : A000005(n) = 4}. - _Juri-Stepan Gerasimov_, Oct 10 2009

%t Select[Range[200], DivisorSigma[0,#]==4&] (* _Harvey P. Dale_, Apr 06 2011 *)

%o (PARI) is(n)=numdiv(n)==4 \\ _Charles R Greathouse IV_, May 18 2015

%o (Magma) [n: n in [1..200] | DivisorSigma(0, n) eq 4]; // _Vincenzo Librandi_, Jul 16 2015

%o (Python)

%o from math import isqrt

%o from sympy import primepi, integer_nthroot, primerange

%o def A030513(n):

%o def f(x): return int(n+x-primepi(integer_nthroot(x,3)[0])+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))

%o m, k = n, f(n)

%o while m != k:

%o m, k = k, f(k)

%o return m # _Chai Wah Wu_, Aug 16 2024

%Y Cf. A000005, A007422, A007956, A030515, A035533, A048272, A119479.

%Y Equals the disjoint union of A006881 and A030078.

%K nonn,easy,nice

%O 1,1

%A _Jeff Burch_

%E Incorrect comments removed by _Charles R Greathouse IV_, Mar 18 2010