%I #27 Apr 16 2023 21:08:56
%S 1,3,1,3,5,7,1,3,1,3,5,7,9,11,13,15,17,19,1,3,1,3,5,7,9,11,13,15,17,
%T 19,21,23,25,27,29,31,33,35,37,39,41,43,1,3,1,3,5,7,1,3,1,3,5,7,9,11,
%U 13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49
%N a(1) = 1, a(n) = a(n-1) / gcd(a(n-1),n) if this gcd is > 1, else a(n) = a(n-1) + 2.
%C A variant of A133058. For n >= 1, a(n) is an odd number. - _Ctibor O. Zizka_, Apr 15 2023
%F For k >= 0:
%F a(7*2^(2*k + 1) - 13) = 1
%F a(7*2^(2*k + 1) - 12) = 3
%F a(7*2^(2*k + 1) - 11) = 1
%F a(7*2^(2*k + 1) - 10) = 3
%F a(7*2^(2*k + 1) - 9) = 5
%F a(7*2^(2*k + 1) - 8) = 7
%F a(7*2^(2*k + 1) - 7) = 1
%F a(7*2^(2*k + 1) - 6) = 3
%F For n from [7*2^(2*k + 1) - 5; 7*2^(2*k + 2) - 10]:
%F a(n) = 2*t + 1, t from [0; 7*2^(2*k + 1) - 5]
%F a(7*2^(2*k + 2) - 9) = 1
%F a(7*2^(2*k + 2) - 8) = 3
%F For n from [7*(2^(2*k + 2) - 7; 7*(2^(2*k + 3) - 14]:
%F a(n) = 2*t + 1, t from [0; 7*2^(2*k + 2) - 7]. - _Ctibor O. Zizka_, Apr 15 2023
%e a(2) = a(1) + 2 = 3, a(3) = a(2)/3 = 1, a(4) = a(3) + 2 = 3, a(5) = a(4) + 2 = 5, ...
%t a[1] = 1; a[n_] := a[n] = If[(g = GCD[a[n-1], n]) > 1, a[n-1]/g, a[n-1] + 2]; Array[a, 100] (* _Amiram Eldar_, May 13 2020 *)
%o (Magma) a:=[1]; for n in [2..70] do if Gcd(a[n-1], n) eq 1 then Append(~a, a[n-1] + 2); else Append(~a, a[n-1] div Gcd(a[n-1], n)); end if; end for; a; // _Marius A. Burtea_, May 13 2020
%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] = va[n-1]+2);); va;} \\ _Michel Marcus_, May 17 2020
%Y Cf. A133058.
%K nonn
%O 1,2
%A _Ctibor O. Zizka_, May 13 2020