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