OFFSET
0,5
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16384
FORMULA
a(2n) = n >= 2; a(p) = 1 for p = prime.
a(n) = 0 if n<=1, else a(n) = 1+a(A046666(n)). - R. J. Mathar, Mar 11 2010
a(n) = (n-lpf(n))/2 + 1 for n > 1, lpf = A020639. - Jianing Song, Aug 07 2022
EXAMPLE
Example (a(6)=3): 6-2=4, 4-2=2, 2-2=0; iterations has 3 steps.
a(25) = 11, as we have 25 -> 20 -> 18 -> 16 -> 14 -> 12 -> 10 -> 8 -> 6 -> 4 -> 2 -> 0, in total eleven steps to reach zero. - Antti Karttunen, Aug 22 2019
MAPLE
Contribution from R. J. Mathar, Mar 11 2010: (Start)
A020639 := proc(n) min(op(numtheory[factorset](n))) ; end proc:
A175126 := proc(n) local a; if n = 1 then 0; elif n = 0 then 0; else 1+procname(A046666(n)) ; end if; end proc:
seq(A175126(n), n=1..100) ; (End)
MATHEMATICA
stps[n_]:=Length[NestWhileList[#-FactorInteger[#][[1, 1]]&, n, #>0&]]-1; Join[{0}, Rest[Array[stps, 90]]] (* Harvey P. Dale, Aug 15 2012 *)
PROG
(PARI)
A020639(n) = if(1==n, n, factor(n)[1, 1]);
(PARI) a(n) = if(n>1, (n-factor(n)[1, 1])/2 + 1, 0) \\ Jianing Song, Aug 07 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jaroslav Krizek, Feb 15 2010
EXTENSIONS
Corrected A-number typo in the comment - R. J. Mathar, Mar 11 2010
Extended beyond a(30) by R. J. Mathar, Mar 11 2010
Term a(0) = 0 prepended by Antti Karttunen, Aug 22 2019
STATUS
approved