A139118 Numbers with a nonprime number of divisors.
1, 6, 8, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102
Offset: 1
Examples
15 is in the sequence because it has 4 divisors: 1, 3, 5, and 15. - _Emeric Deutsch_, Jun 27 2009
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Maple
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
-
Mathematica
Select[Range[102], ! PrimeQ[DivisorSigma[0, #]] &] (* Amiram Eldar, Nov 27 2020 *)
-
PARI
is(n)=!isprime(numdiv(n)) \\ Charles R Greathouse IV, Jun 19 2016
-
Python
from sympy import primepi, integer_nthroot, primerange def A139118(n): def f(x): return int(n+sum(primepi(integer_nthroot(x,k-1)[0]) for k in primerange(x.bit_length()+1))) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Feb 22 2025
Extensions
Extended by Ray Chandler, Jun 25 2009
Comments