login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A334852 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. 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*k-1, .., prime}. The lengths of this subsequences repeats and are [2, 4, 2, 7*2^(2*t-1) - 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[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

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 05:26 EDT 2021. Contains 343030 sequences. (Running on oeis4.)