cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A377613 a(n) is the number of iterations of x -> 2*x + 3 until (# composites reached) = (# primes reached), starting with prime(n).

This page as a plain text file.
%I A377613 #8 Jun 21 2025 19:58:58
%S A377613 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,
%T A377613 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,
%U A377613 19,1,1,1,1,3,1,3,3,1,1,1,3,3,1,17,1,3,1
%N A377613 a(n) is the number of iterations of x -> 2*x + 3 until (# composites reached) = (# primes reached), starting with prime(n).
%C A377613 For a guide to related sequences, see A377609.
%e A377613 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 -> 2*x+3, see A154117.)
%t A377613 chain[{start_, u_, v_}] := NestWhile[Append[#, u*Last[#] + v] &, {start}, !
%t A377613      Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &];
%t A377613 chain[{Prime[1], 2, 3}]
%t A377613 Map[Length[chain[{Prime[#], 2, 3}]] &, Range[100]] - 1
%t A377613 (* _Peter J. C. Moses_ Oct 31 2024 *)
%Y A377613 Cf. A377609, A154117.
%K A377613 nonn
%O A377613 1,1
%A A377613 _Clark Kimberling_, Nov 13 2024