[go: up one dir, main page]

login
A377613
a(n) is the number of iterations of x -> 2*x + 3 until (# composites reached) = (# primes reached), starting with prime(n).
1
19, 1, 15, 15, 1, 13, 13, 15, 1, 3, 1, 1, 1, 7, 27, 3, 1, 1, 25, 1, 3, 1, 1, 5, 23, 1, 1, 1, 1, 7, 3, 1, 23, 3, 1, 1, 9, 1, 17, 5, 1, 1, 1, 3, 19, 7, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 1, 21, 1, 3, 1, 19, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 17, 1, 3, 1
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
Sequence in context: A256642 A040376 A040377 * A040378 A248124 A040379
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 13 2024
STATUS
approved