OFFSET
1,3
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
EXAMPLE
a(8)=22 because for m = 1...29 the cototient values are all smaller than cototient(30)=22, where 30=A065385(8) and 22 is the 8th term in the sequence of such local records.
MATHEMATICA
a=0; s=0; Do[s = n-EulerPhi[n]; If[s>a, a=s; Print[s]], {n, 1, 10000}]
(* Second program: *)
With[{s = Array[# - EulerPhi@ # &, 10^3]}, Union@ FoldList[Max, s]] (* Michael De Vlieger, Nov 03 2017 *)
PROG
(PARI) r=-1; for(n=1, 1000, d=n-eulerphi(n); if(r<d, r=d; print1(r, ", ")))
(PARI) { n=0; x=-1; for (m=1, 10^9, c=m - eulerphi(m); if (c > x, x=c; write("b065386.txt", n++, " ", c); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 17 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 05 2001
STATUS
approved