%I #36 Jun 20 2023 15:00:51
%S 4,4,4,4,5,6,7,8,56,72,91,651,651,1080,1080,1443,20163,20163,246962,
%T 246962,246962,609843,2162162,2162162,29055601,29055601,107881202,
%U 107881202,205405203,205405203,3625549202,5675443203,8374212002,8374212002,8374212002,8374212002,131668891200,131668891200
%N a(n) is the smallest integer k > 3 that satisfies k mod j <= 3 for all integers j in 1..n.
%H Chai Wah Wu, <a href="/A361248/b361248.txt">Table of n, a(n) for n = 1..48</a>
%F For n > 2, n <= a(n) < A003418(n). - _Charles R Greathouse IV_, Apr 27 2023
%e a(11)=91 since 91 mod 11 = 3, 91 mod 10 = 1, 91 mod 9 = 1, 91 mod 8 = 3, 91 mod 7 = 0, 91 mod 6 = 1, 91 mod 5 = 1, 91 mod 4 = 3, 91 mod 3 = 1, 91 mod 2 = 1, 91 mod 1 = 0 and 91 is the smallest integer greater than 3 where all of these remainders are 3 or less.
%o (Python)
%o final=100
%o k=4
%o for n in range(1, final+1):
%o j = n+1
%o while (j > 3):
%o j -= 1
%o if k%j>3:
%o k += j-(k%j)
%o j = n+1
%o print(k)
%o (PARI) isok(k, n) = for (j=5, n, if ((k % j) > 3, return(0))); return(1);
%o a(n) = my(k=4); while(!isok(k, n), k++); k; \\ _Michel Marcus_, Mar 17 2023
%Y Cf. A003418 (all remainders 0).
%Y Cf. A361246, A361247.
%K nonn
%O 1,1
%A _Andrew Cogliano_, Mar 05 2023