OFFSET
1,2
COMMENTS
A variant of A133058. For n >= 1, a(n) is an odd number. - Ctibor O. Zizka, Apr 15 2023
FORMULA
For k >= 0:
a(7*2^(2*k + 1) - 13) = 1
a(7*2^(2*k + 1) - 12) = 3
a(7*2^(2*k + 1) - 11) = 1
a(7*2^(2*k + 1) - 10) = 3
a(7*2^(2*k + 1) - 9) = 5
a(7*2^(2*k + 1) - 8) = 7
a(7*2^(2*k + 1) - 7) = 1
a(7*2^(2*k + 1) - 6) = 3
For n from [7*2^(2*k + 1) - 5; 7*2^(2*k + 2) - 10]:
a(n) = 2*t + 1, t from [0; 7*2^(2*k + 1) - 5]
a(7*2^(2*k + 2) - 9) = 1
a(7*2^(2*k + 2) - 8) = 3
For n from [7*(2^(2*k + 2) - 7; 7*(2^(2*k + 3) - 14]:
a(n) = 2*t + 1, t from [0; 7*2^(2*k + 2) - 7]. - Ctibor O. Zizka, Apr 15 2023
EXAMPLE
a(2) = a(1) + 2 = 3, a(3) = a(2)/3 = 1, a(4) = a(3) + 2 = 3, a(5) = a(4) + 2 = 5, ...
MATHEMATICA
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 13 2020
STATUS
approved