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 A377620 #7 Dec 05 2024 09:26:31 %S A377620 1,5,7,1,7,1,11,1,1,3,1,1,1,1,3,3,1,1,1,5,1,1,7,3,1,13,1,1,1,7,1,7,1, %T A377620 1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,15,1,1,1,3,1,1,1,3,1,1,1, %U A377620 1,1,1,1,1,1,1,1,1,5,1,1,1,5,1,1,1,1 %N A377620 a(n) is the number of iterations of x -> 5*x + 4 until (# composites reached) = (# primes reached), starting with prime(n). %C A377620 For a guide to related sequences, see A377609. %e A377620 Starting with prime(1) = 2, we have 5*2+4 = 14; the chain (2,14) has 1 prime and 1 composite. So a(1) = 2-1 = 1. %t A377620 chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start, %t A377620 NestWhile[Append[#, u*Last[#] + v] &, {start}, ! %t A377620 Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &], {}]; %t A377620 chain[{Prime[1], 5, 4}] %t A377620 Map[Length[chain[{Prime[#], 5, 4}]] &, Range[1, 100]] - 1 %t A377620 (* _Peter J. C. Moses_, Oct 31 2024 *) %Y A377620 Cf. A377609. %K A377620 nonn %O A377620 1,2 %A A377620 _Clark Kimberling_, Nov 20 2024