login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A005087 Number of distinct odd primes dividing n. 28
0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 0, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,15
LINKS
FORMULA
Additive with a(p^e) = 0 if p = 2, 1 otherwise.
a(n) = A001221(n) - 1 + n mod 2. - Reinhard Zumkeller, Sep 03 2003
O.g.f.: Sum_{p=odd prime} x^p/(1-x^p). - Geoffrey Critzer, Nov 06 2012
Sum_{k=1..n} a(k) = n * log(log(n)) + c * n + O(n/log(n)), where c = A077761 - 1/2 = -0.238502... . - Amiram Eldar, Sep 28 2023
MATHEMATICA
nn=100; a=Sum[x^p/(1-x^p), {p, Table[Prime[n], {n, 2, nn}]}]; Drop[CoefficientList[Series[a, {x, 0, nn}], x], 1] (* Geoffrey Critzer, Nov 06 2012 *)
Array[PrimeNu[#] - Boole[EvenQ[#]] &, 102] (* Lei Zhou, Dec 03 2012 *)
PROG
(Sage)
def A005087(n) : return len(prime_divisors(n)) + n % 2 - 1
[A005087(n) for n in (1..80)] # Peter Luschny, Feb 01 2012
(Haskell)
a005087 n = a001221 n + n `mod` 2 - 1 -- Reinhard Zumkeller, Feb 28 2014
(Python)
from sympy import primefactors
def A005087(n): return len(primefactors(n))+(n&1)-1 # Chai Wah Wu, Jul 07 2022
(PARI) a(n) = if (n%2, omega(n), omega(n)-1); \\ Michel Marcus, Sep 18 2023
CROSSREFS
Positions of zeros: A000079.
Positions of ones: A336101.
Sequence in context: A284203 A341594 A368774 * A050332 A369258 A337930
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Reinhard Zumkeller, Sep 03 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)