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!)
A361929 a(1) = 2; for n > 1, a(n) is the smallest positive integer > 1 not to share a factor with terms a(n-c .. n-1) where c = gcd(n-1,a(n-1)). 2
2, 3, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 11, 2, 3, 2, 5, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Conjecture: All primes will occur. See A361931 for the first occurrences of primes.
a(p+1) = 2 or 3 when p is prime.
LINKS
EXAMPLE
For a(26), we see a(25) = 5. Then gcd(25,5) = 5, so a(26) must not share a factor with any of the previous 5 terms. The previous 5 terms {a(21), a(22), a(23), a(24), a(25)} = {3, 7, 2, 3, 5}, and the least positive number not to share a factor with {3, 7, 2, 3, 5} is 11, so a(26) = 11.
The first terms, alongside gcd(n,a(n)):
n a(n) gcd(n,(a(n))
- ---- ----
1 2 1
2 3 1
3 2 1
4 3 1
5 2 1
6 3 3
7 5 1
8 2 2
9 3 3
10 7 1
MATHEMATICA
K = {2}; While[Length@K < 86, p = 2; While[MemberQ[K[[Length@K - GCD[Length@K, Last@K] + 1 ;; Length@K]], p], p = NextPrime[p]]; AppendTo[K, p]]; Print[K]
PROG
(PARI) isok(w, k) = for (i=1, #w, if (gcd(k, w[i]) > 1 , return(0)); ); 1;
lista(nn) = my(va = vector(nn)); va[1] = 2; for (n=2, nn, my(k=2, ok = 0, w = vector(gcd(n-1, va[n-1]), i, va[n-i])); while (!ok, ok = isok(w, k); if (!ok, k++); ); va[n] = k; ); va; \\ Michel Marcus, Mar 31 2023
CROSSREFS
Cf. A358921, A361931 (indices of first occurrences).
Sequence in context: A276090 A073820 A103509 * A252941 A069898 A245511
KEYWORD
nonn
AUTHOR
Samuel Harkness, Mar 30 2023
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 10 17:09 EDT 2024. Contains 373277 sequences. (Running on oeis4.)