OFFSET
1,3
MATHEMATICA
a[1]=a[2]=1; a[n_]:=a[n]=If[GCD[a[n-1], n]==1, a[n-2]+a[n-1]+n, a[n-1]/GCD[a[n-1], n]]; Array[a, 55] (* Stefano Spezia, Mar 20 2023 *)
PROG
(Magma) a:=[1, 1]; for n in [3..50] do if Gcd(a[n-1], n) eq 1 then Append(~a, a[n-2] + a[n-1] + n); else Append(~a, a[n-1] div Gcd(a[n-1], n)); end if; end for; [] cat a;
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hubert W. Westwood, Mar 20 2023
STATUS
approved