

A334852


a(1) = 1, a(n) = a(n1) / gcd(a(n1),n) if this gcd is > 1, else a(n) = a(n1) + 2.


0



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, 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, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

A variant of A133058. For n, k >= 1, a(n) = 2*k 1. The sequence can be splitted into subsequences of the form {1, .., 2*k1, .., prime}. The lengths of this subsequences repeats and are [2, 4, 2, 7*2^(2*t1)  4, 2, 7*2^(2*t)  6], t >= 1. Thus a(n) can be calculated directly from n.


LINKS

Table of n, a(n) for n=1..75.


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[n1], n]) > 1, a[n1]/g, a[n1] + 2]; Array[a, 100] (* Amiram Eldar, May 13 2020 *)


PROG

(MAGMA) a:=[1]; for n in [2..70] do if Gcd(a[n1], n) eq 1 then Append(~a, a[n1] + 2); else Append(~a, a[n1] div Gcd(a[n1], 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[n1], n)); if (g > 1, va[n] = va[n1]/g, va[n] = va[n1]+2); ); va; } \\ Michel Marcus, May 17 2020


CROSSREFS

Cf. A133058.
Sequence in context: A342342 A182600 A179760 * A160552 A256263 A006257
Adjacent sequences: A334849 A334850 A334851 * A334853 A334854 A334855


KEYWORD

nonn


AUTHOR

Ctibor O. Zizka, May 13 2020


STATUS

approved



