OFFSET
0,2
COMMENTS
The companion bisection to A011772.
FORMULA
a(n) = 2*n if 2*n+1 is a prime power. - Chai Wah Wu, Jul 06 2021
PROG
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint, divisors
from sympy.ntheory.modular import crt
def A345444(n):
if n == 0:
return 1
k = 2*n+1
plist = [p**q for p, q in factorint(k).items()]
return k-1 if len(plist) == 1 else int(min(min(crt([m, k//m], [0, -1])[0], crt([k//m, m], [0, -1])[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l)))) # Chai Wah Wu, Jul 06 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 06 2021
STATUS
approved