A366918 a(n) is the number of multiples of n that have exactly n divisors, or -1 if there are infinitely many such numbers.
1, 1, 1, 1, 1, 2, 1, -1, -1, 2, 1, -1, 1, 2, 2, -1, 1, -1, 1, -1, 2, 2, 1, -1, -1, 2, -1, -1, 1, 6, 1, -1, 2, 2, 2, -1, 1, 2, 2, -1, 1, 6, 1, -1, -1, 2, 1, -1, -1, -1, 2, -1, 1, -1, 2, -1, 2, 2, 1, -1, 1, 2, -1, -1, 2, 6, 1, -1, 2, 6, 1, -1, 1, 2, -1, -1, 2, 6, 1, -1, -1, 2, 1, -1, 2, 2, 2, -1, 1, -1, 2, -1, 2, 2, 2
Offset: 1
Keywords
Examples
a(1) = 1 because there is only 1 number that has exactly 1 divisor (namely, 1). For every prime p, a(p) = 1 because the only multiple of p that has exactly p divisors is p^(p-1). a(4) = 1 because the only multiple of 4 that has exactly 4 divisors is 8. (4 itself has only 3 divisors, and 4*k for every k > 2 has more than 4 divisors.) If n is squarefree, then a(n) = w! where w is the number of prime factors of n, because every multiple of n that has exactly n divisors must be of the form p_1^e_1 * p_2^e_2 * ... * p_w^e_w where p_1, p_2, ..., p_w are the prime factors of n and the vector (e_1 + 1, e_2 + 1, ..., e_w + 1) is one of the w! permutations of the vector (p_1, p_2, ..., p_w). If n > 4 is nonsquarefree then a(n) = -1 because there exist infinitely many multiples of n that have exactly n divisors. Examples (where p and q are distinct odd primes and e > 1): n = 2^q: 2^(2^(q-1) - 1) * p has 2^q divisors for every p n = q^e: q^(q^(e-1) - 1) * p^(q-1) has q^e divisors for every p n = 4*q: 2^(q-1)*q*p has 4*q divisors for every p.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..30030
Crossrefs
Programs
-
Mathematica
a[n_]:=If[n==4,1,If[SquareFreeQ[n],PrimeNu[n]!,-1]]; Array[a,78] (* Stefano Spezia, Oct 28 2023 *)
-
PARI
A366918(n) = if(issquarefree(n), omega(n)!, if(4==n, 1, -1)); \\ Antti Karttunen, Jan 29 2025
Formula
Extensions
More terms from Antti Karttunen, Jan 29 2025
Comments