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 A377611 #8 Nov 14 2024 12:11:07 %S A377611 25,1,19,1,11,15,1,1,1,1,13,9,3,1,1,21,1,1,1,11,1,7,1,1,1,1,1,11,17,1, %T A377611 3,1,1,1,1,1,13,1,1,1,5,1,1,1,3,1,3,1,1,1,9,9,1,1,1,15,1,1,1,5,1,1,1, %U A377611 1,1,1,11,1,1,1,1,3,3,1,3,1,1,1,7,1,1,3 %N A377611 a(n) is the number of iterations of x -> 2*x - 5 until (# composites reached) = (# primes reached), starting with prime(n+4). %C A377611 For a guide to related sequences, see A377609. %e A377611 Starting with prime(5) = 11, we have 2*11-5 = 17, then 2*17-5 = 31, etc., resulting in a chain 11, 17, 29, 53, 101, 197, 389, 773, 1541, 3077, 6149, 12293, 24581, 49157, 98309, 196613, 393221, 786437, 1572869, 3145733, 6291461, 12582917, 25165829, 50331653, 100663301, 201326597 having 13 primes and 13 composites. Since every initial subchain has fewer composites than primes, a(1) = 26-1 = 25. %t A377611 chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start, %t A377611 NestWhile[Append[#, u*Last[#] + v] &, {start}, ! %t A377611 Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &], {}]; %t A377611 chain[{Prime[5], 2, -5}] %t A377611 Map[Length[chain[{Prime[#], 2, -5}]] &, Range[5, 100]] - 1 %t A377611 (* _Peter J. C. Moses_, Oct 31 2024 *) %Y A377611 Cf. A377609. %K A377611 nonn %O A377611 1,1 %A A377611 _Clark Kimberling_, Nov 05 2024