[go: up one dir, main page]

login
A377610
a(n) is the number of iterations of x -> 2*x - 3 until (# composites reached) = (# primes reached), starting with prime(n+2).
1
13, 9, 7, 21, 7, 1, 15, 1, 5, 23, 5, 13, 1, 3, 1, 1, 3, 19, 1, 1, 11, 1, 7, 9, 1, 19, 1, 17, 7, 1, 3, 1, 1, 1, 11, 1, 5, 1, 1, 11, 3, 5, 1, 1, 15, 15, 1, 1, 3, 1, 5, 5, 1, 5, 1, 1, 1, 1, 13, 1, 1, 9, 1, 5, 3, 1, 3, 1, 1, 1, 1, 23, 1, 1, 1, 1, 1, 1, 1, 9, 3
OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(3) = 5, we have 2*5-3 = 7, then 2*7-3 = 11, etc., resulting in a chain 5, 7, 11, 19, 35, 67, 131, 259, 515, 1027, 2051, 4099, 8195, 16387 having 7 primes and 7 composites. Since every initial subchain has fewer composites than primes, a(1) = 14-1 = 13. (For more terms from the mapping x -> 2x-3, see A062709.)
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[3], 2, -3}]
Map[Length[chain[{Prime[#], 2, -3}]] &, Range[3, 100]] - 1
(* Peter J. C. Moses, Oct 31 2024 *)
CROSSREFS
Sequence in context: A301825 A300377 A300679 * A304137 A305043 A066552
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 05 2024
STATUS
approved