Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Nov 14 2024 12:10:59
%S 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 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 1,1,1,1,1,1,17,1,1,1,1,1,1,1,1,11,1,3
%N a(n) is the number of iterations of x -> 2*x + 1 until (# composites reached) = (# primes reached), starting with prime(n).
%C For a guide to related sequences, see A377609.
%e 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 chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, !
%t Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &];
%t chain[{Prime[1], 2, 1}]
%t Map[Length[chain[{Prime[#], 2, 1}]] &, Range[100]] - 1
%t (* _Peter J. C. Moses_, Oct 31 2024 *)
%Y Cf. A377609.
%K nonn
%O 1,1
%A _Clark Kimberling_, Nov 05 2024