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.
%I A377157 #15 Oct 26 2024 10:44:05 %S A377157 1,2,3,5,4,6,8,10,12,14,16,18,20,15,24,9,21,27,30,33,22,11,7,13,17,19, %T A377157 23,25,26,40,28,32,34,36,38,42,44,46,48,50,45,35,55,60,65,39,52,54,56, %U A377157 58,62,64,66,68,51,72,57,63,69,75,78,70,74,76,80,82,84,86,88,90,92,94,96,98,100,102,85,105,95,110,114,99,81,87,93,108,111,117,120,104 %N A377157 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) if a(n-1) is prime and coprime to a(n-2) if a(n-2) is prime, else a(n) shares a factor with a(n-1) and a(n-2) if both are composite. %C A377157 Similar to A375564 the primes appear in clusters separated by runs of composites. However unlike A375564 the runs of primes are interrupted by occasional composites, typically toward the end of the run - see the attaching image of the first 5000 terms. The first prime in the runs can also be larger than one or more subsequent primes, so unlike A375564, the primes do not all occur in their natural order; in the first 3000000 terms the out-of-order primes are 11 and 3581. %C A377157 The runs of primes also appear to occur much less frequently than in A375564 - the last known run begins at a(156233) = 3581 and ends at a(169394) = 146857, and no more primes appear up to 3000000 terms. %C A377157 The fixed points begin 1, 2, 3, 6, 32, 57, 119, 343, 3123, 3859, 120481. The sequence is conjectured to be a permutation of the positive integers. %H A377157 Scott R. Shannon, <a href="/A377157/b377157.txt">Table of n, a(n) for n = 1..10000</a> %H A377157 Scott R. Shannon, <a href="/A377157/a377157_1.png">Image of the first 5000 terms</a>. The terms are colored red, yellow, green, blue, violet if they have one, two, three, four, or five or more prime factors. The thin white line is a(n) = n. %H A377157 Scott R. Shannon, <a href="/A377157/a377157.png">Image of the first 1000000 terms</a>. %e A377157 a(5) = 4 as both a(3) = 3 and a(4) = 5 are prime so a(5) must be coprime to both, and 4 is the smallest unused number coprime to both 3 and 5. %e A377157 a(6) = 6 as a(4) = 5 is prime so a(6) must be coprime to a(4), and 6 is the smallest unused number coprime to 5. %e A377157 a(7) = 8 as both a(5) = 4 and a(6) = 6 are composite so a(7) must share a factor with both, and 8 is the smallest unused number that shares a factor with both 4 and 6. %Y A377157 Cf. A375564, A375563, A098550, A336957, A000040. %K A377157 nonn %O A377157 1,2 %A A377157 _Scott R. Shannon_, Oct 18 2024