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 A377610 #8 Nov 14 2024 12:11:03 %S A377610 13,9,7,21,7,1,15,1,5,23,5,13,1,3,1,1,3,19,1,1,11,1,7,9,1,19,1,17,7,1, %T A377610 3,1,1,1,11,1,5,1,1,11,3,5,1,1,15,15,1,1,3,1,5,5,1,5,1,1,1,1,13,1,1,9, %U A377610 1,5,3,1,3,1,1,1,1,23,1,1,1,1,1,1,1,9,3 %N A377610 a(n) is the number of iterations of x -> 2*x - 3 until (# composites reached) = (# primes reached), starting with prime(n+2). %C A377610 For a guide to related sequences, see A377609. %e A377610 Starting with prime(3) = 5, we have 2*5-3 = 7, then 2*7-3 = 11, etc., resulting in a chain 5, 7, 11, 19, 35, 67, 131, 259, 515, 1027, 2051, 4099, 8195, 16387 having 7 primes and 7 composites. Since every initial subchain has fewer composites than primes, a(1) = 14-1 = 13. (For more terms from the mapping x -> 2x-3, see A062709.) %t A377610 chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start, %t A377610 NestWhile[Append[#, u*Last[#] + v] &, {start}, ! %t A377610 Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &], {}]; %t A377610 chain[{Prime[3], 2, -3}] %t A377610 Map[Length[chain[{Prime[#], 2, -3}]] &, Range[3, 100]] - 1 %t A377610 (* _Peter J. C. Moses_, Oct 31 2024 *) %Y A377610 Cf. A062709, A377609. %K A377610 nonn %O A377610 1,1 %A A377610 _Clark Kimberling_, Nov 05 2024