OFFSET
1,2
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
N. J. A. Sloane, Table of n, a(n) for n = 1..100000
MATHEMATICA
spm[n_]:=Module[{m=1}, While[!Divisible[m(m+1), n], m++]; m]; Accumulate[ Array[ spm, 100]] (* Harvey P. Dale, Dec 04 2022 *)
PROG
(Python 3.8+)
from itertools import combinations, count, islice
from math import prod
from sympy import factorint
from sympy.ntheory.modular import crt
def A345983_gen(): # generator of terms
c = 1
for n in count(2):
yield c
plist = tuple(p**q for p, q in factorint(n).items())
c += n-1 if len(plist) == 1 else 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))))
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 09 2021
STATUS
approved