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.
%I A175126 #26 Aug 07 2022 13:35:40 %S A175126 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, %T A175126 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, %U A175126 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 %N 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. %C A175126 See A005843 and A175127 for the smallest and greatest numbers m such that a(m) = k for k >= 2. %H A175126 Antti Karttunen, <a href="/A175126/b175126.txt">Table of n, a(n) for n = 0..16384</a> %F A175126 a(2n) = n >= 2; a(p) = 1 for p = prime. %F A175126 a(n) = 0 if n<=1, else a(n) = 1+a(A046666(n)). - _R. J. Mathar_, Mar 11 2010 %F A175126 a(n) = (n-lpf(n))/2 + 1 for n > 1, lpf = A020639. - _Jianing Song_, Aug 07 2022 %e A175126 Example (a(6)=3): 6-2=4, 4-2=2, 2-2=0; iterations has 3 steps. %e A175126 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 %p A175126 Contribution from _R. J. Mathar_, Mar 11 2010: (Start) %p A175126 A020639 := proc(n) min(op(numtheory[factorset](n))) ; end proc: %p A175126 A046666 := proc(n) n-A020639(n) ; end proc: %p A175126 A175126 := proc(n) local a; if n = 1 then 0; elif n = 0 then 0; else 1+procname(A046666(n)) ; end if; end proc: %p A175126 seq(A175126(n),n=1..100) ; (End) %t A175126 stps[n_]:=Length[NestWhileList[#-FactorInteger[#][[1,1]]&,n,#>0&]]-1; Join[{0},Rest[Array[stps,90]]] (* _Harvey P. Dale_, Aug 15 2012 *) %o A175126 (PARI) %o A175126 A020639(n) = if(1==n, n, factor(n)[1, 1]); %o A175126 A175126(n) = if(n<2,0,1+A175126(n-A020639(n))); \\ _Antti Karttunen_, Aug 22 2019 %o A175126 (PARI) a(n) = if(n>1, (n-factor(n)[1, 1])/2 + 1, 0) \\ _Jianing Song_, Aug 07 2022 %Y A175126 Cf. A020639, A046666, A309892. %Y A175126 From a(2) on, one more than A046667. %K A175126 nonn,easy %O A175126 0,5 %A A175126 _Jaroslav Krizek_, Feb 15 2010 %E A175126 Corrected A-number typo in the comment - _R. J. Mathar_, Mar 11 2010 %E A175126 Extended beyond a(30) by _R. J. Mathar_, Mar 11 2010 %E A175126 Term a(0) = 0 prepended by _Antti Karttunen_, Aug 22 2019