The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A352962 a(1) = 2, a(n) = Min(n,a(n-1)) if gcd(n,a(n-1)) = 1, else a(n) = n + 2. 0
2, 4, 3, 3, 3, 8, 7, 7, 7, 7, 7, 7, 7, 16, 15, 15, 15, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 40, 39, 39, 39, 44, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(1) = 2, gcd(2,2) = 2 thus a(2) = 4
a(2) = 4, gcd(3,4) = 1 thus a(3) = Min(3,4) = 3
a(3) = 3, gcd(4,3) = 1 thus a(4) = Min(4,3) = 3, etc.
MATHEMATICA
a[1] = 2; a[n_] := a[n] = If[CoprimeQ[n, a[n - 1]], Min[n, a[n - 1]], n + 2]; Array[a, 100] (* Amiram Eldar, Apr 11 2022 *)
PROG
(Python)
from math import gcd
from itertools import count, islice
def A352962_gen(): # generator of terms
a = 2
yield a
for n in count(2):
yield (a:= min(n, a) if gcd(n, a) == 1 else n+2)
A352962_list = list(islice(A352962_gen(), 30)) # Chai Wah Wu, May 24 2022
CROSSREFS
Sequence in context: A220080 A343766 A299920 * A137363 A110549 A174574
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Apr 11 2022
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 1 17:33 EDT 2024. Contains 373025 sequences. (Running on oeis4.)