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.

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

This page as a plain text file.
%I A377624 #7 Dec 05 2024 09:26:09
%S A377624 17,5,1,3,9,11,15,1,1,3,7,5,5,7,1,1,5,1,1,7,5,5,9,1,5,1,1,9,3,13,1,1,
%T A377624 5,9,1,11,5,7,1,1,1,13,5,7,9,1,1,1,3,1,1,9,3,3,1,3,7,1,9,1,1,1,5,5,1,
%U A377624 13,1,3,9,3,1,1,3,17,1,1,5,1,3,9,1,5,5,1
%N A377624 a(n) is the number of iterations of x -> 6*x + 5 until (# composites reached) = (# primes reached), starting with prime(n).
%C A377624 For a guide to related sequences, see A377609.
%e A377624 Starting with prime(1) = 2, we have 6*2+5 = 17, then 6*17+5 = 107, etc., resulting in a chain 2, 17, 107, 647, 3887, 23327, 139967, 839807, 5038847, 30233087, 181398527, 1088391167, 6530347007, 39182082047, 235092492287, 1410554953727, 8463329722367, 50779978334207 having 9 primes and 9 composites. Since every initial subchain has fewer composites than primes, a(1) = 18-1 = 17. (For more terms from the mapping x -> 6x-5, see A198796.)
%t A377624 chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start,
%t A377624    NestWhile[Append[#, u*Last[#] + v] &, {start}, !
%t A377624       Count[#, _?PrimeQ] == Count[#, _?(! PrimeQ[#] &)] &], {}];
%t A377624 chain[{Prime[1], 6, -5}]
%t A377624 Map[Length[chain[{Prime[#], 6, -5}]] &, Range[1, 100]] - 1
%t A377624 (* _Peter J. C. Moses_, Oct 31 2024 *)
%Y A377624 Cf. A377609, A198796.
%K A377624 nonn
%O A377624 1,1
%A A377624 _Clark Kimberling_, Nov 20 2024