OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(1) = 2, we have 2*2+7 = 11, then 2*11+7 = 29, etc., resulting in a chain 2, 11, 29, 65, 137, 281, 569, 1145, 2297, 4601, 9209, 18425, 36857, 73721, 147449, 294905, 589817, 1179641, 2359289, 4718585, 9437177, 18874361, 37748729, 75497465 having 24 primes and 24 composites. Since every initial subchain has fewer composites than primes, a(1) = 24-1 = 23. (For more terms from the mapping x -> 2x+7, see A154251.)
MATHEMATICA
chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, !
Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &];
chain[{Prime[1], 2, 7}]
Map[Length[chain[{Prime[#], 2, 7}]] &, Range[100]] - 1
(* Peter J. C. Moses Oct 31 2024 *)
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 13 2024
STATUS
approved