OFFSET
1,4
COMMENTS
LINKS
T. D. Noe, Table of n, a(n) for n=1..10000
EXAMPLE
The numbers coprime to 15 are 1,2,4,7,8,11,13,14,16,17,19,22,... Observe that the differences are periodic: 1,2,3,1,3,2,1,2,1,2,3,... The maximum value is 3, which occurs twice in the first period. Hence a(15)=2.
MATHEMATICA
JacobsthalCount[n_] := Module[{g, d, mx}, g=Select[Range[n+1], GCD[n, # ]==1&]; d=Rest[g]-Most[g]; mx=Max@@d; Count[d, mx]]; Table[JacobsthalCount[n], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Mar 24 2007
STATUS
approved