login
A377623
a(n) is the number of iterations of x -> 6*x + 1 until (# composites reached) = (# primes reached), starting with prime(n).
1
15, 5, 5, 3, 3, 13, 7, 1, 5, 1, 1, 3, 1, 1, 7, 1, 1, 7, 1, 1, 3, 1, 7, 1, 1, 9, 5, 3, 1, 1, 1, 5, 3, 1, 1, 5, 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 3, 1, 5, 3, 1, 3, 5, 1, 5, 7, 1, 9, 1, 3, 1, 1, 1, 5, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 9
OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(1) = 2, we have 6*2+1 = 13, then 6*13+1 = 79, etc., resulting in a chain 2, 13, 79, 475, 2851, 17107, 102643, 615859, 3695155, 22170931, 133025587, 798153523, 4788921139, 28733526835, 172401161011, 1034406966067 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 -> 6x-5, see A198849.)
MATHEMATICA
chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start,
NestWhile[Append[#, u*Last[#] + v] &, {start}, !
Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &], {}];
chain[{Prime[1], 6, -5}]
Map[Length[chain[{Prime[#], 6, -5}]] &, Range[1, 100]] - 1
(* Peter J. C. Moses, Oct 31 2024 *)
CROSSREFS
Sequence in context: A296009 A104436 A070601 * A332843 A196187 A004480
KEYWORD
nonn
AUTHOR
Clark Kimberling, Nov 20 2024
STATUS
approved