login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Let f(n) = n - pi(n). Then a(n) = least number of steps such that f(f(...(n)))=1.
2

%I #5 Dec 05 2013 19:56:38

%S 1,1,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,

%T 6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,

%U 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9

%N Let f(n) = n - pi(n). Then a(n) = least number of steps such that f(f(...(n)))=1.

%e a(10) = 3, 10 ->6 ->3 ->1.

%e a(100) = 9.

%e f(100) =100-25 = 75, f(75) = 75-21= 54, f(54) = 54-16 = 38, f(38) = 38-12= 26, f(26) = 26-9 = 17, f(17) = 17-7 = 10, f(10) = 10-4 =6, f(6) = 6-3=3, f(3) = 3-2 =1.

%Y Cf. A025003.

%K nonn

%O 2,3

%A _Amarnath Murthy_, Dec 07 2003

%E Corrected and extended by Sam Handler (sam_5_5_5_0(AT)yahoo.com), Dec 11 2004