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.

A377182 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1) while a(n-1) mod a(n) has not previously occurred as the mod value for any consecutive pair of terms.

This page as a plain text file.
%I A377182 #17 Oct 19 2024 22:29:13
%S A377182 2,3,4,6,8,9,10,12,14,15,16,18,20,21,22,24,26,27,28,30,32,25,35,40,42,
%T A377182 44,33,55,36,38,39,34,45,46,48,50,51,52,54,56,57,58,60,62,63,64,66,68,
%U A377182 69,70,72,49,92,98,100,102,65,74,75,76,78,80,81,82,84,86,87,88,90,77,91,99,104,105,106,108,110,93,119,120,126,85,123,125,96,116,117,118,129,130
%N A377182 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1) while a(n-1) mod a(n) has not previously occurred as the mod value for any consecutive pair of terms.
%C A377182 To ensure the sequence is infinite a(n) must be chosen so that a(n-1) mod a(n) is not 0 or 1. Care must also be taken when choosing a(n) if it is equal to any previously occurring mod value as one is not then guaranteed the next term will exist - in such cases smaller unused mod values must be checked for a valid next term, otherwise the term must be rejected and the next largest candidate trialled.
%C A377182 Surprisingly the first prime to occur is a(94122) = 47857. The next is a(103105) = 26591, and no other primes appear in the first 500000 terms. It is unknown if more occur or why it takes so many terms for a prime to appear. Many small primes, like 5, can never occur as all mod values less than the prime have already appeared. It is conjectured all missing numbers are prime.
%C A377182 In the first 500000 terms the fixed points are 111, 533, 649, 11957; it is unknown if more exist.
%C A377182 Keyword "look" refers to Scott Shannon's image of 100000 terms. - _N. J. A. Sloane_, Oct 19 2024
%H A377182 Scott R. Shannon, <a href="/A377182/b377182.txt">Table of n, a(n) for n = 1..10000</a>
%H A377182 Michael De Vlieger, <a href="/A377182/a377182_1.png">Log log scatterplot of a(n)</a>, n = 1..2^17, showing primes in red, perfect prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue and purple, accentuating powerful numbers that are not prime powers in purple.
%H A377182 Scott R. Shannon, <a href="/A377182/a377182.png">Image of the first 100000 terms</a>. The green line is a(n) = n.
%e A377182 a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3 while 3 has not occurred as a mod value for any previous pair.
%e A377182 a(9) = 14 as a(7) mod a(8) = 10 mod 12 = 10, and 14 factor with 10. Note that 5 is unused and shares a factor with 10 but a(8) mod 5 = 12 mod 5 = 2, but 2 has previously occurred as the mod value for a(1) mod a(2), so 5 cannot be used. This is the first term to differ from A377078.
%t A377182 nn = 120;
%t A377182 c[_] := False; m[_] := False;
%t A377182 Array[Set[{a[#], c[# + 1]}, {# + 1, True}] &, 2];
%t A377182 Set[{i, j, v}, {a[1], a[2], 2}];
%t A377182 mj = Mod[i, j]; Array[Set[m[#], True] &, mj + 1, 0];
%t A377182 Do[k = v;
%t A377182   While[Set[mk, Mod[j, k]]; Or[c[k], m[mk], m[k], CoprimeQ[mj, k]], k++];
%t A377182   While[m[v], v++];
%t A377182   Set[{a[n], c[k], m[mk], i, j, mj}, {k, True, True, j, k, mk}], {n, 3, nn}];
%t A377182 Array[a, nn] (* _Michael De Vlieger_, Oct 19 2024 *)
%Y A377182 Cf. A377078, A064413, A359557, A270139, A027749.
%K A377182 nonn,look
%O A377182 1,1
%A A377182 _Scott R. Shannon_, Oct 18 2024