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.

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.

Original entry on oeis.org

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

Views

Author

Jason Earls, Sep 23 2002

Keywords

Examples

			a(12)=4 because 12 -> 3 -> 2 -> 1 -> 0.
		

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