OFFSET
0,6
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
a(5) = 2 because 5 == 0 (mod 1), == 1 (mod 2), == 2 (mod 3), but there is no j > 3 with 5 == 3 (mod j).
a(11) = 4 because 11 == 0 (mod 1), == 1 (mod 2), == 2 (mod 3), == 3 (mod 4), == 4 (mod 7), but there is no j > 7 with 11 == 5 (mod j).
MAPLE
F:= proc(m) local L, j, k;
L:= [seq(m mod j, j=1..m-1)];
k:= 0; j:= 1;
for k from 1 do
do j:= j+1;
if j = m then return k-1 fi;
until L[j] = k
od;
end proc:
F(0):= 0:
F(1):= 1:
map(F, [$0..100]);
CROSSREFS
KEYWORD
nonn,hear
AUTHOR
J. M. Bergot and Robert Israel, Dec 06 2019
STATUS
approved