OFFSET
1,2
LINKS
Dana G. Korssjoen, Biyao Li, Stefan Steinerberger, Raghavendra Tripathi, and Ruimin Zhang, Finding structure in sequences of real numbers via graph theory: a problem list, arXiv:2012.04625 [math.CO], Dec 08, 2020. See Section 2.6.
MATHEMATICA
DeleteDuplicates@ Block[{a = {1, 1}, k = 1}, Do[AppendTo[a, If[# == 1, a[[-1]] + i + 1, a[[-1]]/#]] &@ GCD[a[[-1]], i], {i, 2, 80}]; a] (* Michael De Vlieger, Dec 09 2020 *)
PROG
(PARI) lista(nn) = my(v=List([1]), x=1, y); print1(1); for(n=2, nn, if(!setsearch(Set(v), x=if(1==y=gcd(x, n), x+n+1, x/y)), print1(", ", x); listput(v, x))); \\ Jinyuan Wang, Dec 12 2020
(Python)
from math import gcd
from itertools import count, islice
def A339571_gen(): # generator of terms
a, aset = 1, {1}
yield 1
for n in count(2):
a = a+n+1 if (b:=gcd(a, n)) == 1 else a//b
if a not in aset:
aset.add(a)
yield a
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 09 2020
EXTENSIONS
More terms from Jinyuan Wang, Dec 12 2020
STATUS
approved