login
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.
3
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,2
LINKS
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.
EXAMPLE
a(12)=4 because 12 -> 3 -> 2 -> 1 -> 0.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A325494 A295561 A076423 * A270788 A190496 A193926
KEYWORD
nonn
AUTHOR
Jason Earls, Sep 23 2002
STATUS
approved