OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..112
FORMULA
a(n) = A064219(n)+1. - Chai Wah Wu, Jun 19 2023
EXAMPLE
a(7)=36 since 36 mod 7 = 1, 36 mod 6 = 0, 36 mod 5 = 1, 36 mod 4 = 0, 36 mod 3 = 0, 36 mod 2 = 0, 36 mod 1 = 0 and 36 is the smallest integer greater than 1 where all of these remainders are 1 or less.
PROG
(Python)
final=100
k=2
for n in range(1, final+1):
j = n+1
while (j > 1):
j -= 1
if k%j>1:
k += j-(k%j)
j = n+1
print(k)
(Python)
from math import lcm
from itertools import product
from sympy.ntheory.modular import solve_congruence
def A361246(n):
if n == 1: return 2
alist, blist, c, klist = [], [], 1, list(range(n, 1, -1))
while klist:
k = klist.pop(0)
if not c%k:
blist.append(k)
else:
c = lcm(c, k)
alist.append(k)
for m in klist.copy():
if not k%m:
klist.remove(m)
for d in product([0, 1], repeat=len(alist)):
x = solve_congruence(*list(zip(d, alist)))
if x is not None:
y = x[0]
if y > 1:
for b in blist:
if y%b > 1:
break
else:
if y < c:
c = y
return int(c) # Chai Wah Wu, Jun 19 2023
(PARI) isok(k, n) = for (j=1, n, if ((k % j) > 1, return(0))); return(1);
a(n) = my(k=2); while(!isok(k, n), k++); k; \\ Michel Marcus, Mar 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Cogliano, Mar 05 2023
STATUS
approved