This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A336164 #27 Mar 18 2023 18:05:18 %S A336164 1,2,4,1,5,10,16,2,10,1,11,22,34,17,31,46,62,31,49,68,88,4,26,13,37, %T A336164 62,88,22,50,5,35,66,2,1,35,70,106,53,91,130,170,85,127,170,34,17,63, %U A336164 21,3,52,102,51,103,156,210,15,5,62,120,2,62,1,63,126,190,95,161,228,76 %N A336164 a(1) = 1; if n>1, and gcd(a(n-1), n) > 1 then a(n) = a(n-1)/gcd(a(n-1), n), otherwise a(n) = a(n-1) + n - 1. %o A336164 (PARI) a(n) = if (n==1, 1, my(prec=a(n-1)); if (gcd(prec, n) > 1, prec/gcd(prec,n), n-1+prec)); \\ _Michel Marcus_, Jul 13 2020 %o A336164 (Python) %o A336164 from itertools import count, islice %o A336164 from math import gcd %o A336164 def A336164_gen(): # generator of terms %o A336164 yield (a:=1) %o A336164 for n in count(2): %o A336164 yield (a:=a+n-1 if (b:=gcd(a,n)) == 1 else a//b) %o A336164 A336164_list = list(islice(A336164_gen(),30)) # _Chai Wah Wu_, Mar 18 2023 %Y A336164 Cf. A133058. %K A336164 nonn %O A336164 1,2 %A A336164 _Todor Szimeonov_, Jul 10 2020