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.

A139118 Numbers with a nonprime number of divisors.

This page as a plain text file.
%I A139118 #20 Feb 22 2025 12:05:04
%S A139118 1,6,8,10,12,14,15,18,20,21,22,24,26,27,28,30,32,33,34,35,36,38,39,40,
%T A139118 42,44,45,46,48,50,51,52,54,55,56,57,58,60,62,63,65,66,68,69,70,72,74,
%U A139118 75,76,77,78,80,82,84,85,86,87,88,90,91,92,93,94,95,96,98,99,100,102
%N A139118 Numbers with a nonprime number of divisors.
%C A139118 A000005(a(n)) is nonprime. Complement of A009087. Also, nonprime numbers with nonprime number of divisors.
%C A139118 The sequence consists of those n such that n is not a prime power, or n of the form p^k where k+1 is composite. - _Franklin T. Adams-Watters_, Apr 09 2009
%H A139118 Amiram Eldar, <a href="/A139118/b139118.txt">Table of n, a(n) for n = 1..10000</a>
%e A139118 15 is in the sequence because it has 4 divisors: 1, 3, 5, and 15. - _Emeric Deutsch_, Jun 27 2009
%p A139118 with(numtheory): a := proc (n) if isprime(tau(n)) = false then n else end if end proc: seq(a(n), n = 1 .. 120); # _Emeric Deutsch_, Jun 27 2009
%t A139118 Select[Range[102], ! PrimeQ[DivisorSigma[0, #]] &] (* _Amiram Eldar_, Nov 27 2020 *)
%o A139118 (PARI) is(n)=!isprime(numdiv(n)) \\ _Charles R Greathouse IV_, Jun 19 2016
%o A139118 (Python)
%o A139118 from sympy import primepi, integer_nthroot, primerange
%o A139118 def A139118(n):
%o A139118     def f(x): return int(n+sum(primepi(integer_nthroot(x,k-1)[0]) for k in primerange(x.bit_length()+1)))
%o A139118     m, k = n, f(n)
%o A139118     while m != k: m, k = k, f(k)
%o A139118     return m # _Chai Wah Wu_, Feb 22 2025
%Y A139118 Cf. A000005, A009087, A018252.
%K A139118 easy,nonn
%O A139118 1,2
%A A139118 _Omar E. Pol_, May 09 2008
%E A139118 Extended by _Ray Chandler_, Jun 25 2009