[go: up one dir, main page]

login
A377615
a(n) is the number of iterations of x -> 2*x + 7 until (# composites reached) = (# primes reached), starting with prime(n).
1
23, 7, 9, 1, 21, 1, 7, 1, 21, 1, 1, 1, 3, 1, 3, 19, 1, 1, 1, 5, 1, 1, 7, 1, 1, 1, 1, 1, 1, 17, 1, 9, 17, 1, 1, 1, 1, 1, 1, 5, 1, 1, 3, 1, 15, 1, 1, 1, 9, 1, 1, 1, 1, 3, 17, 1, 1, 1, 1, 15, 1, 11, 1, 1, 1, 5, 1, 1, 11, 1, 1, 1, 1, 1, 1, 23, 1, 1, 11, 1, 1, 1
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
Sequence in context: A158514 A040511 A264350 * A058287 A122706 A096640
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 13 2024
STATUS
approved