OFFSET
1,3
EXAMPLE
For n=3, the longest gap in 1, 2, 4, 5, 7, 8 is 1, between 2 and 4 and again between 5 and 7, so a(3) = 2.
For n=4, the longest gap in 1, 3, 5, 7, 9, 11, 13, 15 is 1, at (1,3), (3,5), (5,7), (7,9), (9,11), (11,13) and (13,15), so a(4) = 7.
The numbers coprime to 6 and smaller than 36 are {1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35}, the largest distance between two consecutive terms is 4; 4 appears as a distance in the cases (1,5),(7,11),(13,17),(19,23),(25,29) and (31,35) - it appears 6 times. Therefore a(6)=6.
MATHEMATICA
a = {}; For[n = 1, n < 70, n++, b = Select[Range[1, n^2], GCD[ #, n] == 1 &]; m = 0; For[j = 1, j < Length[b], j++, If[b[[j + 1]] - b[[j]] > m, m = b[[j + 1]] - b[[j]]]]; c = 0; For[j = 1, j < Length[b], j++, If[b[[j + 1]] - b[[j]] == m, c++ ]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Nov 20 2007 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Nov 16 2007
EXTENSIONS
Corrected and extended by Stefan Steinerberger, Nov 20 2007
STATUS
approved