|
|
A175126
|
|
a(0) = a(1) = 0, for n >= 2, a(n) = number of steps of iteration of {r - (smallest prime divisor of r)} needed to reach 0 starting at r = n.
|
|
5
|
|
|
0, 0, 1, 1, 2, 1, 3, 1, 4, 4, 5, 1, 6, 1, 7, 7, 8, 1, 9, 1, 10, 10, 11, 1, 12, 11, 13, 13, 14, 1, 15, 1, 16, 16, 17, 16, 18, 1, 19, 19, 20, 1, 21, 1, 22, 22, 23, 1, 24, 22, 25, 25, 26, 1, 27, 26, 28, 28, 29, 1, 30, 1, 31, 31, 32, 31, 33, 1, 34, 34, 35, 1, 36, 1, 37, 37, 38, 36, 39, 1, 40, 40
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
See A005843 and A175127 for the smallest and greatest numbers m such that a(m) = k for k >= 2.
|
|
LINKS
|
|
|
FORMULA
|
a(2n) = n >= 2; a(p) = 1 for p = prime.
|
|
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
|
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:
|
|
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
|
From a(2) on, one more than A046667.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Corrected A-number typo in the comment - R. J. Mathar, Mar 11 2010
|
|
STATUS
|
approved
|
|
|
|