login

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”).

A377621
a(n) is the number of iterations of x -> 6*x - 1 until (# composites reached) = (# primes reached), starting with prime(n).
1
11, 7, 7, 3, 1, 1, 3, 5, 5, 5, 1, 1, 1, 3, 3, 5, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 3, 5, 3, 3, 1, 3, 1, 1, 1, 3, 5, 1, 1, 1, 1, 1, 1, 9, 3, 1, 1, 5, 7, 1, 9, 1, 1, 1, 1, 9, 1, 1, 1, 5, 1, 1, 1, 5, 3, 1, 1, 3, 1, 1, 5, 1, 7, 3, 9, 7, 3, 1, 1, 1, 1, 1, 1, 7, 3
OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(1) = 2, we have 6*2-1 = 11, then 6*11-1 = 65, etc., resulting in a chain 2, 11, 65, 389, 2333, 13997, 83981, 503885, 3023309, 18139853, 108839117, 653034701 having 6 primes and 6 composites. Since every initial subchain has fewer composites than primes, a(1) = 12-1 = 11. (For more terms from the mapping x -> 6x-1, see A199412.)
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, -1}]
Map[Length[chain[{Prime[#], 6, -1}]] &, Range[1, 100]] - 1
(* Peter J. C. Moses, Oct 31 2024 *)
CROSSREFS
Sequence in context: A240598 A144262 A110093 * A282345 A265765 A187563
KEYWORD
nonn
AUTHOR
Clark Kimberling, Nov 20 2024
STATUS
approved