A201971 a(n) is the largest m such that n is congruent to -2, -1, 0, 1 or 2 mod k for all k from 1 to m.
5, 6, 7, 8, 9, 10, 5, 6, 6, 7, 7, 8, 5, 9, 6, 6, 7, 7, 5, 8, 8, 6, 6, 9, 5, 7, 7, 8, 6, 6, 5, 9, 7, 7, 7, 6, 5, 8, 8, 8, 7, 7, 5, 6, 9, 8, 8, 8, 5, 6, 6, 9, 9, 9, 5, 8, 6, 6, 7, 10, 5, 9, 9, 6, 6, 7, 5, 10, 10, 10, 6, 6, 5, 7, 7, 8, 11, 6, 5, 10, 7, 7, 7, 8, 5
Offset: 3
Crossrefs
Cf. A187824.
Programs
-
Mathematica
f[n_] := Block[{k = 4, r}, While[r = Mod[n, k]; r < 3 || k - r < 3, k++]; k - 1]; Array[f, 100, 3]