A105561 a(n) is the m-th prime, where m is the number of distinct prime factors of n (A001221), a(1) = 1.
1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 2, 5, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 5, 2, 3, 3, 2, 3, 5, 2, 3, 3, 5, 2, 3, 2, 3, 3, 3, 3, 5, 2, 3, 2, 3, 2, 5, 3, 3, 3, 3, 2, 5, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 5, 2, 3, 5, 3, 2, 3, 2, 5, 3, 3, 2, 5, 3, 3, 3, 3, 3, 5
Offset: 1
Examples
Let n = 6; 6 has 2 different prime factors, therefore a(6) = 3, the second prime.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[Prime[Length[FactorInteger[n]]], {n, 2, 84}] Prime[PrimeNu[Range[2,90]]] (* Harvey P. Dale, Oct 02 2013 *)
-
PARI
A105561(n) = if(1==n,n,prime(omega(n))); \\ [After the original Pari-program given here.] - Antti Karttunen, May 25 2017
-
Python
from sympy import prime, primefactors def a(n): return 1 if n==1 else prime(len(primefactors(n))) # Indranil Ghosh, May 25 2017
Extensions
Edited by Stefan Steinerberger, Jun 15 2007
Term a(1) = 1 prepended (correcting also the indexing of the rest of terms), and data section extended to 120 terms by Antti Karttunen, May 25 2017
Comments