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 A377612 #8 Nov 14 2024 12:10:59 %S A377612 15,7,13,1,11,1,1,1,7,7,1,1,5,1,1,11,1,1,1,1,1,1,3,23,1,1,1,1,1,11,1, %T A377612 3,1,1,1,1,1,1,1,3,19,1,3,1,1,1,1,1,1,1,7,3,1,3,1,1,1,1,1,3,1,7,1,1,1, %U A377612 1,1,1,1,1,1,17,1,1,1,1,1,1,1,1,11,1,3 %N A377612 a(n) is the number of iterations of x -> 2*x + 1 until (# composites reached) = (# primes reached), starting with prime(n). %C A377612 For a guide to related sequences, see A377609. %e A377612 Starting with prime(1) = 2, we have 2*2+1 = 5, then 2*5+1 = 11, etc., resulting in a chain 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 983033 having 8 primes and 8 composites. Since every initial subchain has fewer composites than primes, a(1) = 16-1 = 15. (For more terms from the mapping x -> 2x+1, see A055010.) %t A377612 chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, ! %t A377612 Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &]; %t A377612 chain[{Prime[1], 2, 1}] %t A377612 Map[Length[chain[{Prime[#], 2, 1}]] &, Range[100]] - 1 %t A377612 (* _Peter J. C. Moses_, Oct 31 2024 *) %Y A377612 Cf. A377609. %K A377612 nonn %O A377612 1,1 %A A377612 _Clark Kimberling_, Nov 05 2024