OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..40
EXAMPLE
a(7)=30 since 30 mod 7 = 2, 30 mod 6 = 0, 30 mod 5 = 0, 30 mod 4 = 2, 30 mod 3 = 0, 30 mod 2 = 0 and 30 is the smallest integer greater than 2 where all of these remainders are 2 or less.
PROG
(Python)
final=100
k=3
for n in range(1, final+1):
j = n+1
while (j > 2):
j -= 1
if k%j>2:
k += j-(k%j)
j = n+1
print(k)
(PARI) isok(k, n) = for (j=1, n, if ((k % j) > 2, return(0))); return(1);
a(n) = my(k=3); while(!isok(k, n), k++); k; \\ Michel Marcus, Mar 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Cogliano, Mar 05 2023
EXTENSIONS
a(32)-a(36) from Chai Wah Wu, Apr 24 2023
STATUS
approved