[go: up one dir, main page]

login
A377612
a(n) is the number of iterations of x -> 2*x + 1 until (# composites reached) = (# primes reached), starting with prime(n).
1
15, 7, 13, 1, 11, 1, 1, 1, 7, 7, 1, 1, 5, 1, 1, 11, 1, 1, 1, 1, 1, 1, 3, 23, 1, 1, 1, 1, 1, 11, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 19, 1, 3, 1, 1, 1, 1, 1, 1, 1, 7, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 3
OFFSET
1,1
COMMENTS
For a guide to related sequences, see A377609.
EXAMPLE
Starting with prime(1) = 2, we have 2*2+1 = 5, then 2*5+1 = 11, etc., resulting in a chain 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 983033 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 -> 2x+1, see A055010.)
MATHEMATICA
chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, !
Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &];
chain[{Prime[1], 2, 1}]
Map[Length[chain[{Prime[#], 2, 1}]] &, Range[100]] - 1
(* Peter J. C. Moses, Oct 31 2024 *)
CROSSREFS
Cf. A377609.
Sequence in context: A240909 A133817 A173447 * A168211 A131876 A325136
KEYWORD
nonn,new
AUTHOR
Clark Kimberling, Nov 05 2024
STATUS
approved