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.

A231813 Number of iterations of A046665(n) = (greatest prime divisor of n) - (least prime divisor of n) [with A046665(1) = 0] required to reach zero.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 3, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 3, 3, 2, 1, 2, 1, 3, 2, 2, 2, 2, 1, 2, 1, 4, 1, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2
Offset: 0

Views

Author

Clark Kimberling, Dec 11 2013

Keywords

Examples

			A046665(6) = 3 - 2, and A046665(1) = 0, so a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 400; h[n_] := h[n] = FactorInteger[n][[-1, 1]] - FactorInteger[n][[1, 1]]; t[n_] := Drop[FixedPointList[h, n], -2]; Table[t[n], {n, 1, z}]; a = Table[Length[t[n]], {n, 1, z}]
  • PARI
    A046665(n) = if(1==n,0, my(f = factor(n), lpf = f[1, 1], gpf = f[#f~, 1]); (gpf-lpf));
    A231813(n) = if(0==n,0, 1+A231813(A046665(n))); \\ Antti Karttunen, Jan 03 2019

Formula

a(0) = 0; for n > 0, a(n) = 1 + a(A046665(n)). - Antti Karttunen, Jan 03 2019

Extensions

Name edited, term a(0)=0 prepended and more terms added by Antti Karttunen, Jan 03 2019