login
A361247
a(n) is the smallest integer k > 2 that satisfies k mod j <= 2 for all integers j in 1..n.
3
3, 3, 3, 4, 5, 6, 30, 42, 56, 72, 792, 792, 1080, 1080, 1080, 30240, 246961, 246961, 636482, 636482, 1360801, 2162162, 2162162, 2162162, 39412802, 39412802, 107881202, 107881202, 3625549202, 3625549202, 3625549202, 170918748001, 170918748001, 170918748001, 170918748001, 170918748001
OFFSET
1,1
LINKS
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
Cf. A003418 (all remainders 0).
Cf. also A361246, A361248.
Equals {A056697}+1. - Hugo Pfoertner, May 11 2023
Sequence in context: A090903 A022878 A022877 * A151554 A221028 A334940
KEYWORD
nonn
AUTHOR
Andrew Cogliano, Mar 05 2023
EXTENSIONS
a(32)-a(36) from Chai Wah Wu, Apr 24 2023
STATUS
approved