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.

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

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Nov 05 2024

Keywords

Comments

For a guide to related sequences, see A377609.

Examples

			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.)
		

Crossrefs

Programs

  • 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 *)