OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..48
FORMULA
For n > 2, n <= a(n) < A003418(n). - Charles R Greathouse IV, Apr 27 2023
EXAMPLE
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.
PROG
(Python)
final=100
k=4
for n in range(1, final+1):
j = n+1
while (j > 3):
j -= 1
if k%j>3:
k += j-(k%j)
j = n+1
print(k)
(PARI) isok(k, n) = for (j=5, n, if ((k % j) > 3, return(0))); return(1);
a(n) = my(k=4); while(!isok(k, n), k++); k; \\ Michel Marcus, Mar 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Cogliano, Mar 05 2023
STATUS
approved