cp's OEIS Frontend

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.

A087624 a(n)=0 if n is prime, A001221(n) otherwise.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 1, 1, 2, 0, 2, 0, 2, 2, 1, 0, 2, 0, 2, 2, 2, 0, 2, 1, 2, 1, 2, 0, 3, 0, 1, 2, 2, 2, 2, 0, 2, 2, 2, 0, 3, 0, 2, 2, 2, 0, 2, 1, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 3, 0, 2, 2, 1, 2, 3, 0, 2, 2, 3, 0, 2, 0, 2, 2, 2, 2, 3, 0, 2, 1, 2, 0, 3, 2, 2, 2, 2, 0, 3, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 3, 0, 2, 3
Offset: 1

Views

Author

Michele Dondi (bik.mido(AT)tiscalinet.it), Sep 14 2003

Keywords

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

Crossrefs

A144489 gives partial sums.

Programs

  • Haskell
    a087624 n = if a010051 n == 1 then 0 else a001221 n
    -- Reinhard Zumkeller, Apr 05 2013
    
  • 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 *)
  • PARI
    a(n) = if (isprime(n), 0, omega(n)); \\ Michel Marcus, Nov 06 2022

Formula

a(n) = A001221(n) * A005171(n). - Jason Kimberley, Nov 19 2014
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

Extensions

Edited by N. J. A. Sloane, Dec 11 2008