cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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)).

This page as a plain text file.
%I A361929 #31 Mar 26 2025 08:32:22
%S A361929 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,
%T A361929 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,
%U A361929 3,7,11,2,3,2,5,7,2,3,5,2,3,7,2,3,5,11
%N 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)).
%C A361929 Conjecture: All primes will occur. See A361931 for the first occurrences of primes.
%C A361929 a(p+1) = 2 or 3 when p is prime.
%H A361929 Samuel Harkness, <a href="/A361929/b361929.txt">Table of n, a(n) for n = 1..13812</a>
%e A361929 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.
%e A361929 The first terms, alongside gcd(n,a(n)):
%e A361929   n  a(n)  gcd(n,a(n))
%e A361929   -  ----  ----
%e A361929   1     2     1
%e A361929   2     3     1
%e A361929   3     2     1
%e A361929   4     3     1
%e A361929   5     2     1
%e A361929   6     3     3
%e A361929   7     5     1
%e A361929   8     2     2
%e A361929   9     3     3
%e A361929   10    7     1
%t A361929 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]
%o A361929 (PARI) isok(w, k) = for (i=1, #w, if (gcd(k, w[i]) > 1 , return(0));); 1;
%o A361929 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
%Y A361929 Cf. A358921, A361931 (indices of first occurrences).
%K A361929 nonn
%O A361929 1,1
%A A361929 _Samuel Harkness_, Mar 30 2023