OFFSET
1,1
COMMENTS
a(n) = n-1 if n is a prime power. - Chai Wah Wu, Jun 04 2021
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..10000
PROG
(PARI) a(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m*(m+1)/n))) \\ Felix Fröhlich, Jun 04 2021
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint
from sympy.ntheory.modular import crt
def A344006(n):
if n == 1:
return 2
plist = [p**q for p, q in factorint(n).items()]
if len(plist) == 1:
return n-1
else:
m = int(min(min(crt([m, n//m], [0, -1])[0], crt([n//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))))
return m*(m+1)//n # Chai Wah Wu, Jun 04 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 04 2021
STATUS
approved