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.
%I A366918 #19 Jan 29 2025 17:30:48 %S A366918 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, %T A366918 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, %U A366918 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 %N A366918 a(n) is the number of multiples of n that have exactly n divisors, or -1 if there are infinitely many such numbers. %C A366918 a(n) = -1 for each nonsquarefree n > 4 with n = Product_{j=1..w} p_j ^ e_j because there exist infinitely many multiples of n that have exactly n divisors. Included among such multiples are all numbers of the form c*q^(b-1) where b is the smallest prime factor of n, q is any prime that does not divide n, and c = Product_{j=1..w} p_j ^ (d_j - 1), with the d_j values chosen so that Product_{j=1..w} d_j = n/b and d_j > e_j for j = 1..w. %H A366918 Antti Karttunen, <a href="/A366918/b366918.txt">Table of n, a(n) for n = 1..30030</a> %F A366918 a(n) = omega(n)! if n is squarefree (where omega(n) = A001221(n)), %F A366918 1 if n = 4, and %F A366918 -1 otherwise. %e A366918 a(1) = 1 because there is only 1 number that has exactly 1 divisor (namely, 1). %e A366918 For every prime p, a(p) = 1 because the only multiple of p that has exactly p divisors is p^(p-1). %e A366918 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.) %e A366918 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). %e A366918 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): %e A366918 n = 2^q: 2^(2^(q-1) - 1) * p has 2^q divisors for every p %e A366918 n = q^e: q^(q^(e-1) - 1) * p^(q-1) has q^e divisors for every p %e A366918 n = 4*q: 2^(q-1)*q*p has 4*q divisors for every p. %t A366918 a[n_]:=If[n==4,1,If[SquareFreeQ[n],PrimeNu[n]!,-1]]; Array[a,78] (* _Stefano Spezia_, Oct 28 2023 *) %o A366918 (PARI) A366918(n) = if(issquarefree(n), omega(n)!, if(4==n, 1, -1)); \\ _Antti Karttunen_, Jan 29 2025 %Y A366918 Cf. A000005, A001221, A073904, A080756. %Y A366918 Cf. A000142 (records), A002110 (and their positions). %K A366918 sign %O A366918 1,6 %A A366918 _Jon E. Schoenfield_, Oct 28 2023 %E A366918 More terms from _Antti Karttunen_, Jan 29 2025