A075660 Let f(n) = abs(lpd(n)-gpf(n)), where lpd(n) is the largest proper divisor of n and gpf(n) is the greatest prime factor of n. Sequence gives number of iterations for f(n) to reach zero.
1, 2, 3, 1, 2, 1, 2, 3, 1, 1, 2, 4, 5, 1, 1, 2, 3, 2, 3, 3, 1, 1, 2, 2, 1, 1, 2, 3, 4, 2, 3, 2, 1, 1, 1, 2, 3, 1, 1, 2, 3, 2, 3, 3, 2, 1, 2, 2, 1, 4, 1, 6, 7, 3, 1, 2, 1, 1, 2, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 4, 5, 2, 3, 1, 4, 4, 1, 2, 3, 2, 3, 1, 2, 2, 1, 1, 1, 2, 3, 3, 1, 3, 1, 1, 1, 3, 4, 3, 2, 3
Offset: 1
Keywords
Examples
a(12)=4 because 12 -> 3 -> 2 -> 1 -> 0.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Jason Earls, Smarandache iterations of the first kind on functions involving divisors and prime factors, in Smarandache Notions Journal (2004), Vol. 14.1, page 259.
Programs
-
Mathematica
Array[-1 + Length@ NestWhileList[Function[n, Abs[If[n == 1, 0, #[[-2]]] - SelectFirst[Reverse@ #, PrimeQ]] &@ Divisors[n]], #, # > 0 &] &, 100] (* Michael De Vlieger, Mar 28 2018 *)
-
PARI
lpd(n)=n/factor(n)[1,1]; gpf(n)=my(f=factor(n)[,1]); f[#f]; f(n)=abs(lpd(n)-gpf(n)); a(n)=my(k=1); while(n=f(n), k++); k \\ Charles R Greathouse IV, May 30 2014