%I #15 Jun 21 2018 10:38:48
%S 1,2,4,6,10,12,18,24,30,36,42,48,54,60,66,72,78,84,90,102,108,114,120,
%T 126,132,138,144,150,168,180,198,204,210,240,252,264,270,294,300,330,
%U 360,378,390,420,450,462,480,504,510,540,546,570,600,630,660,690,714
%N Numbers m at which value of cototient function (A051953) reaches a new record: cototient(m) > cototient(k) for all k < m.
%C For totient values prime numbers give similar records.
%H Harry J. Smith, <a href="/A065385/b065385.txt">Table of n, a(n) for n = 1..1000</a>
%F a=0; s=0; Do[s=n-EulerPhi[n]; If[s>a, a=s; Print[n]], {n, 1, 10000}]
%e a(8) = 30 because for m = 1...29 the cototient values are all smaller than cototient(30) = 22 = A065386(8) and this is the 8th number at which such a record is reached; analogous sequences are A002093, A002182, A015702 or A005250 for functions other than cototient.
%t With[{s = Array[# - EulerPhi@ # &, 10^3]}, Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* _Michael De Vlieger_, May 16 2018 *)
%o (PARI) r=-1; for(n=1,1000,d=n-eulerphi(n); if(r<d,r=d; print1(n,",")))
%o (PARI) { n=0; x=-1; for (m=1, 10^9, c=m - eulerphi(m); if (c > x, x=c; write("b065385.txt", n++, " ", m); if (n==1000, return)) ) } \\ _Harry J. Smith_, Oct 17 2009
%Y Cf. A051953, A065386.
%K nonn
%O 1,2
%A _Labos Elemer_, Nov 05 2001