login
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.
0
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,1
MATHEMATICA
f[n_] := Block[{k = 4, r}, While[r = Mod[n, k]; r < 3 || k - r < 3, k++]; k - 1]; Array[f, 100, 3]
CROSSREFS
Cf. A187824.
Sequence in context: A346172 A114547 A217293 * A169869 A163508 A168095
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Jan 09 2013
STATUS
approved