A128707 Least number having the maximal distance between consecutive integers coprime to n.
1, 1, 2, 1, 4, 1, 6, 1, 2, 3, 10, 1, 12, 5, 4, 1, 16, 1, 18, 3, 5, 9, 22, 1, 4, 11, 2, 5, 28, 1, 30, 1, 10, 15, 13, 1, 36, 17, 11, 3, 40, 5, 42, 9, 4, 21, 46, 1, 6, 3, 16, 11, 52, 1, 9, 5, 17, 27, 58, 1, 60, 29, 5, 1, 24, 7, 66, 15, 22, 3, 70, 1, 72, 35, 4, 17, 20, 11, 78, 3, 2, 39, 82, 5, 33
Offset: 1
Keywords
Examples
The numbers coprime to 10 are 1,3,7,9,11,13,17,19,... Observe that the differences are periodic: 2,4,2,2,2,4,2,... The largest distance between the coprime numbers is 4, which first occurs between 3 and 7. Hence j(10)=4 and a(10)=3.
Links
- T. D. Noe, Table of n, a(n) for n=1..10000
Crossrefs
Cf. A128708 (number of times the maximal value occurs).
Programs
-
Mathematica
JacobsthalPos[n_] := Module[{g,d,mx,pos}, g=Select[Range[n+1], GCD[n,# ]==1&]; d=Rest[g]-Most[g]; mx=Max@@d; pos=Position[d,mx,1,1][[1,1]]; g[[pos]]]; Table[JacobsthalPos[n], {n,100}]
Comments