OFFSET
1,6
COMMENTS
Number of prime divisors of n, but excluding n itself if n is prime.
Number of non-associated primes in the ring Z_n.
Also for n > 1 the number of times n is crossed off in the sieve of Eratosthenes (A000040). - Reinhard Zumkeller, Oct 17 2008
Number of primes that are proper divisors of n. - Omar E. Pol, Dec 27 2008
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
Index entries for sequences generated by sieves [From Reinhard Zumkeller, Oct 17 2008]
FORMULA
G.f.: Sum_{k>=1} x^(2*prime(k)) / (1 - x^prime(k)). - Ilya Gutkovskiy, Apr 13 2021
a(n) = omega(n) - c(n), where c = A010051. - Wesley Ivan Hurt, Jun 23 2024
MAPLE
with(numtheory); f:=proc(n) if isprime(n) then nops(factorset(n))-1 else nops(factorset(n)) fi; end;
MATHEMATICA
Array[If[PrimeQ[#], 0, PrimeNu[#]]&, 110] (* Harvey P. Dale, Mar 27 2013 *)
PROG
(Haskell)
a087624 n = if a010051 n == 1 then 0 else a001221 n
-- Reinhard Zumkeller, Apr 05 2013
(PARI) a(n) = if (isprime(n), 0, omega(n)); \\ Michel Marcus, Nov 06 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michele Dondi (bik.mido(AT)tiscalinet.it), Sep 14 2003
EXTENSIONS
Edited by N. J. A. Sloane, Dec 11 2008
STATUS
approved