login
A330241
a(n) is the greatest k such that there is an increasing sequence of positive integers j(0),j(1),...,j(k) such that n == i (mod j(i)) for each i.
2
0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 3, 4, 3, 4, 1, 2, 3, 4, 5, 6, 3, 4, 1
OFFSET
0,6
COMMENTS
If n == -1 (mod A003418(k)), then a(n) == j mod (j+1) for j <= k-1, so a(n) >= k-1. In particular, the sequence is unbounded.
a(n) = 1 if n is in A008864.
a(n+1) <= a(n)+1, with equality if n is even.
LINKS
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