%I #5 Mar 27 2015 09:31:30
%S 0,1,1,2,1,1,1,2,2,2,1,2,1,2,2,3,1,2,1,2,2,3,1,2,3,2,3,2,1,3,1,4,2,3,
%T 2,2,1,2,2,3,1,4,1,2,2,3,1,2,5,2,2,2,1,6,3,2,3,4,1,3,1,2,2,3,2,3,1,6,
%U 2,3,1,2,1,3,2,4,2,4,1,2,5,3,1,3,3,2,4
%N Number of iterations needed to reach 0 or 1 under the map n-> n-sopf(n), where sopf(n) is the sum of the distinct primes dividing n (A008472).
%H Michel Lagneau, <a href="/A256122/b256122.txt">Table of n, a(n) for n = 1..10000</a>
%e a(16) = 3 because:
%e 16 - sopf(16) = 16 - 2 = 14 (first iteration);
%e 14 - sopf(14) = 14 - 9 = 5 (second iteration);
%e 5 - sopf(5)= 5 - 5 = 0 (third iteration and reaching 0).
%e a(22) = 3 because:
%e 22 - sopf(22) = 22 - 13 = 9 (first iteration);
%e 9 - sopf(9) = 9 - 3 = 6 (second iteration);
%e 6 - sopf(6)= 6 - 5 = 1 (third iteration and reaching 1).
%p A008472:= n -> add(d, d = select(isprime, numtheory[divisors](n))):
%p A:= proc(n)
%p a := 0 ;
%p x := n ;
%p while x>1 do
%p x := x-A008472(x) ;
%p a := a+1 ;
%p end do:
%p a ;
%p end proc:
%p seq(A(n), n=1..100);
%t t[n_] := -1 + Length[NestWhileList[#-Total[Transpose[FactorInteger[#]][[1]]]&, n, #>1&]]; Table[t[n], {n, 100}]
%Y Cf. A008472.
%K nonn
%O 1,4
%A _Michel Lagneau_, Mar 15 2015
|