Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Nov 05 2021 13:30:42
%S 1,6,2,1,6,1,6,3,1,6,16,4,12,6,2,1,6,1,6,3,1,6,16,2,8,4,12,3,10,1,6,3,
%T 1,6,16,4,12,6,2,1,6,1,6,3,1,6,16,1,6,3,1,6,16,8,20,5,14,7,18,3,10,5,
%U 14,7,18,3,10,5,14,1,6,1,6,3,1,6,16,8,20,1,6
%N a(1) = 1, a(n) = a(n-1) / gcd(a(n-1),n) if this gcd is > 1, else a(n) = 2*a(n-1) + 4.
%C A variant of A133058.
%e a(2) = 2*a(1) + 4 = 6, a(3) = a(2)/3 = 2, a(4) = a(3)/2 = 1, a(5) = 2*a(4) + 4 = 6, ...
%t a[1] = 1; a[n_] := a[n] = If[(g = GCD[a[n-1], n]) > 1, a[n-1]/g, 2*a[n-1] + 4]; Array[a, 100].
%o (PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(g = gcd(va[n-1], n)); if (g > 1, va[n] = va[n-1]/g, va[n] = 2*va[n-1] + 4);); va;} \\ _Michel Marcus_, May 17 2020
%Y Cf. A133058.
%K nonn
%O 1,2
%A _Ctibor O. Zizka_, May 17 2020