OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(1) = 2, we have 2*2+3 = 7, then 2*7+3 = 17, etc.,
resulting in a chain 2, 7, 17, 37, 77, 157, 317, 637, 1277, 2557, 5117, 10237, 20477, 40957, 81917, 163837, 327677, 655357, 1310717, 2621437 having 10 primes and 10 composites. Since every initial subchain has fewer composites than primes, a(1) = 20-1 = 19. (For more terms from the mapping x -> 2x+3, see A154117.)
MATHEMATICA
chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, !
Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &];
chain[{Prime[1], 2, 3}]
Map[Length[chain[{Prime[#], 2, 3}]] &, Range[100]] - 1
(* Peter J. C. Moses Oct 31 2024 *
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 13 2024
STATUS
approved