login
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.
2
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,7
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16384 (terms 1..1000 from Clark Kimberling)
FORMULA
a(0) = 0; for n > 0, a(n) = 1 + a(A046665(n)). - Antti Karttunen, Jan 03 2019
EXAMPLE
A046665(6) = 3 - 2, and A046665(1) = 0, so a(6) = 2.
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}]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Dec 11 2013
EXTENSIONS
Name edited, term a(0)=0 prepended and more terms added by Antti Karttunen, Jan 03 2019
STATUS
approved