A287841 Number of iterations of number of distinct prime factors (A001221) needed to reach 1 starting at n (n is counted).
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, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3
Offset: 1
Keywords
Examples
If n = 6 the trajectory is {6, 2, 1}. Its length is 3, thus a(6) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
- Eric Weisstein's World of Mathematics, Distinct Prime Factors
- Index entries for sequences computed from exponents in factorization of n
Crossrefs
Programs
-
Mathematica
f[n_] := Length[NestWhileList[ PrimeNu, n, # != 1 &]]; Array[f, 105] a[1] = 1; a[n_] := a[n] = a[PrimeNu[n]] + 1; Table[a[n], {n, 105}]
-
PARI
A287841(n) = if(1==n,n,1+A287841(omega(n))); \\ Antti Karttunen, Nov 23 2017
-
Python
from sympy import primefactors def a(n): return 1 if n==1 else a(len(primefactors(n))) + 1 # Indranil Ghosh, Jun 03 2017
Formula
a(n) = a(omega(n)) + 1 for n > 1, where omega() is the number of distinct prime factors.