login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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