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, 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
Keywords
Examples
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.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..40
Crossrefs
Cf. A003418 (all remainders 0).
Equals {A056697}+1. - Hugo Pfoertner, May 11 2023
Programs
-
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
-
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)
Extensions
a(32)-a(36) from Chai Wah Wu, Apr 24 2023