OFFSET
1,2
PROG
(Python)
from sympy.ntheory.modular import crt
from sympy import factorint
from itertools import product
def A343998(n):
fs = factorint(2*n)
plist = [p**fs[p] for p in fs]
return (1+min(k for k in (crt(plist, d)[0] for d in product([0, -1], repeat=len(plist))) if k > 0))//2 # Chai Wah Wu, Jun 01 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 01 2021
STATUS
approved